@ulb-darmstadt/shacl-form 1.8.3 → 1.9.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.
@@ -1,30 +1,30 @@
1
- var Br=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kp(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Jp(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var t=function r(){var n=!1;try{n=this instanceof r}catch{}return n?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 Ao={},mn={},ad;function Qp(){if(ad)return mn;ad=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 ws={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var ld;function Xp(){return ld||(ld=1,ws.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)},ws.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}),ws}/*!
1
+ var cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tm(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Cm(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var t=function r(){var n=!1;try{n=this instanceof r}catch{}return n?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 ra={},qn={},Td;function $m(){if(Td)return qn;Td=1,qn.byteLength=a,qn.toByteArray=l,qn.fromByteArray=p;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(g){var v=g.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var _=g.indexOf("=");_===-1&&(_=v);var E=_===v?0:4-_%4;return[_,E]}function a(g){var v=o(g),_=v[0],E=v[1];return(_+E)*3/4-E}function c(g,v,_){return(v+_)*3/4-_}function l(g){var v,_=o(g),E=_[0],x=_[1],k=new t(c(g,E,x)),y=0,h=x>0?E-4:E,m;for(m=0;m<h;m+=4)v=e[g.charCodeAt(m)]<<18|e[g.charCodeAt(m+1)]<<12|e[g.charCodeAt(m+2)]<<6|e[g.charCodeAt(m+3)],k[y++]=v>>16&255,k[y++]=v>>8&255,k[y++]=v&255;return x===2&&(v=e[g.charCodeAt(m)]<<2|e[g.charCodeAt(m+1)]>>4,k[y++]=v&255),x===1&&(v=e[g.charCodeAt(m)]<<10|e[g.charCodeAt(m+1)]<<4|e[g.charCodeAt(m+2)]>>2,k[y++]=v>>8&255,k[y++]=v&255),k}function d(g){return i[g>>18&63]+i[g>>12&63]+i[g>>6&63]+i[g&63]}function u(g,v,_){for(var E,x=[],k=v;k<_;k+=3)E=(g[k]<<16&16711680)+(g[k+1]<<8&65280)+(g[k+2]&255),x.push(d(E));return x.join("")}function p(g){for(var v,_=g.length,E=_%3,x=[],k=16383,y=0,h=_-E;y<h;y+=k)x.push(u(g,y,y+k>h?h:y+k));return E===1?(v=g[_-1],x.push(i[v>>2]+i[v<<4&63]+"==")):E===2&&(v=(g[_-2]<<8)+g[_-1],x.push(i[v>>10]+i[v>>4&63]+i[v<<2&63]+"=")),x.join("")}return qn}var Js={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Cd;function Am(){return Cd||(Cd=1,Js.read=function(i,e,t,r,n){var s,o,a=n*8-r-1,c=(1<<a)-1,l=c>>1,d=-7,u=t?n-1:0,p=t?-1:1,g=i[e+u];for(u+=p,s=g&(1<<-d)-1,g>>=-d,d+=a;d>0;s=s*256+i[e+u],u+=p,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=r;d>0;o=o*256+i[e+u],u+=p,d-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-l}return(g?-1:1)*o*Math.pow(2,s-r)},Js.write=function(i,e,t,r,n,s){var o,a,c,l=s*8-n-1,d=(1<<l)-1,u=d>>1,p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:s-1,v=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*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+u>=1?e+=p/c:e+=p*Math.pow(2,1-u),e*c>=2&&(o++,c/=2),o+u>=d?(a=0,o=d):o+u>=1?(a=(e*c-1)*Math.pow(2,n),o=o+u):(a=e*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;i[t+g]=a&255,g+=v,a/=256,n-=8);for(o=o<<n|a,l+=n;l>0;i[t+g]=o&255,g+=v,o/=256,l-=8);i[t+g-v]|=_*128}),Js}/*!
2
2
  * The buffer module from node.js, for the browser.
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */var cd;function Hi(){return cd||(cd=1,function(i){const e=Qp(),t=Xp(),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 X=4096;function A(C){const h=C.length;if(h<=X)return String.fromCharCode.apply(String,C);let p="",B=0;for(;B<h;)p+=String.fromCharCode.apply(String,C.slice(B,B+=X));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+=St[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=Be(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=Be(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=Be(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=Be(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=Be(function(h,p=0){return J(this,h,p,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Be(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=Be(function(h,p=0){return J(this,h,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Be(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 St=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 Be(C){return typeof BigInt>"u"?Ct:C}function Ct(){throw new Error("BigInt not supported")}}(Ao)),Ao}var Yp=Hi();const gn="http://www.w3.org/1999/02/22-rdf-syntax-ns#",yn="http://www.w3.org/2001/XMLSchema#",_s="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:`${_s}reify#forSome`,forAll:`${_s}reify#forAll`},log:{implies:`${_s}log#implies`,isImpliedBy:`${_s}log#isImpliedBy`}},{xsd:xs}=_t,Zp=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,dd={"\\":"\\","'":"'",'"':'"',n:`
7
- `,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},em=/[\x00-\x20<>\\"\{\}\|\^\`]/,tm={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},im=/$0^/;class rm{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 tm)&&this[t]instanceof RegExp&&(this[t]=im)}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||em.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"?xs.double:typeof b[2]=="string"?xs.decimal:xs.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=xs.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(Zp,(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 dd?dd[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=Yp.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:nm,xsd:br}=_t;let on,sm=0;const Fe={namedNode:sf,blankNode:of,variable:lf,literal:af,defaultGraph:cm,quad:wl,triple:wl,fromTerm:Bn,fromQuad:cf};class wi{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof wi?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 so=class extends wi{get termType(){return"NamedNode"}},ai=class nf extends wi{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 so(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:nm.langString}equals(e){return e instanceof nf?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}}}},om=class extends wi{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},am=class extends wi{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},lm=class extends wi{constructor(){return super(""),on||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};on=new lm;function jn(i,e,t){if(e=e||Fe,!i)return e.defaultGraph();switch(i[0]){case"?":return e.variable(i.substr(1));case"_":return e.blankNode(i.substr(2));case'"':if(e===Fe)return new ai(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 Fr(i,e){if(typeof i=="string")return i;if(i instanceof wi&&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=[Fr(i.subject,!0),Fr(i.predicate,!0),Fr(i.object,!0)];return i.graph&&i.graph.termType!=="DefaultGraph"&&t.push(Fr(i.graph,!0)),e?t:JSON.stringify(t);default:throw new Error(`Unexpected termType: ${i.termType}`)}}let oo=class extends wi{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 sf(i){return new so(i)}function of(i){return new om(i||`n3-${sm++}`)}function af(i,e){if(typeof e=="string")return new ai(`"${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 ai(`"${i}"`):new ai(`"${i}"^^${t}`)}function lf(i){return new am(i)}function cm(){return on}function wl(i,e,t,r){return new oo(i,e,t,r)}function Bn(i){if(i instanceof wi)return i;switch(i.termType){case"NamedNode":return sf(i.value);case"BlankNode":return of(i.value);case"Variable":return lf(i.value);case"DefaultGraph":return on;case"Literal":return af(i.value,i.language||i.datatype);case"Quad":return cf(i);default:throw new Error(`Unexpected termType: ${i.termType}`)}}function cf(i){if(i instanceof oo)return i;if(i.termType!=="Quad")throw new Error(`Unexpected termType: ${i.termType}`);return wl(Bn(i.subject),Bn(i.predicate),Bn(i.object),Bn(i.graph))}let ud=0;class _l{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&df(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 rm({lineMode:l,n3:a,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){ud=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=Es}_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${ud++}_`,this._prefixCallback=s||Es,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=Es):this._readCallback&&(this._readCallback=this._readCallback(c))};o&&(this._lexer.comments=!0,a=(l,c)=>{l!==null?(this._callback(l),this._callback=Es):this._readCallback&&(c.type==="comment"?o(c.value):this._readCallback=this._readCallback(c))}),this._callback=n,this._lexer.tokenize(e,a)}}function Es(){}function df(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")}df(_l.prototype,Fe);function xl(i){return!!i&&i.termType==="DefaultGraph"}function Ds(i){return i.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const dm=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,um=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,hd="./",hm="../",No="?",fd="#";class rc{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!dm.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!rc.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",Ds(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]===fd?l=s.lastIndex-1:(t.push(Ds(o[0]),"(?:"),r.push(")?"),o[1]!==No?n.push(c=s.lastIndex):(a=c=s.lastIndex,l=this.base.indexOf(fd,a),this._pathReplacements[a]=No));for(let d=0;d<n.length;d++)this._pathReplacements[n[d]]=hm.repeat(n.length-d-1);return this._pathReplacements[n[n.length-1]]=hd,this._baseLength=l>0?l:this.base.length,t.push(Ds(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!==No&&!um.test(s)?e:n===hd&&/^[^?#]/.test(s)?s:n+s}return e.substring(r-1)}}const bn=Fe.defaultGraph(),{rdf:fm,xsd:Dr}=_t,pd=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,md=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,pm={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class vn extends wi{equals(e){return e===this}}class nc{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 rc(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?`.
6
+ */var $d;function sr(){return $d||($d=1,function(i){const e=$m(),t=Am(),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 A=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(A,f),A.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(A){if(A>n)throw new RangeError('The value "'+A+'" is invalid for option "size"');const f=new Uint8Array(A);return Object.setPrototypeOf(f,a.prototype),f}function a(A,f,b){if(typeof A=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(A)}return c(A,f,b)}a.poolSize=8192;function c(A,f,b){if(typeof A=="string")return p(A,f);if(ArrayBuffer.isView(A))return v(A);if(A==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A);if(fe(A,ArrayBuffer)||A&&fe(A.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(fe(A,SharedArrayBuffer)||A&&fe(A.buffer,SharedArrayBuffer)))return _(A,f,b);if(typeof A=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const j=A.valueOf&&A.valueOf();if(j!=null&&j!==A)return a.from(j,f,b);const te=E(A);if(te)return te;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof A[Symbol.toPrimitive]=="function")return a.from(A[Symbol.toPrimitive]("string"),f,b);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A)}a.from=function(A,f,b){return c(A,f,b)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(A){if(typeof A!="number")throw new TypeError('"size" argument must be of type number');if(A<0)throw new RangeError('The value "'+A+'" is invalid for option "size"')}function d(A,f,b){return l(A),A<=0?o(A):f!==void 0?typeof b=="string"?o(A).fill(f,b):o(A).fill(f):o(A)}a.alloc=function(A,f,b){return d(A,f,b)};function u(A){return l(A),o(A<0?0:x(A)|0)}a.allocUnsafe=function(A){return u(A)},a.allocUnsafeSlow=function(A){return u(A)};function p(A,f){if((typeof f!="string"||f==="")&&(f="utf8"),!a.isEncoding(f))throw new TypeError("Unknown encoding: "+f);const b=y(A,f)|0;let j=o(b);const te=j.write(A,f);return te!==b&&(j=j.slice(0,te)),j}function g(A){const f=A.length<0?0:x(A.length)|0,b=o(f);for(let j=0;j<f;j+=1)b[j]=A[j]&255;return b}function v(A){if(fe(A,Uint8Array)){const f=new Uint8Array(A);return _(f.buffer,f.byteOffset,f.byteLength)}return g(A)}function _(A,f,b){if(f<0||A.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(A.byteLength<f+(b||0))throw new RangeError('"length" is outside of buffer bounds');let j;return f===void 0&&b===void 0?j=new Uint8Array(A):b===void 0?j=new Uint8Array(A,f):j=new Uint8Array(A,f,b),Object.setPrototypeOf(j,a.prototype),j}function E(A){if(a.isBuffer(A)){const f=x(A.length)|0,b=o(f);return b.length===0||A.copy(b,0,0,f),b}if(A.length!==void 0)return typeof A.length!="number"||Ve(A.length)?o(0):g(A);if(A.type==="Buffer"&&Array.isArray(A.data))return g(A.data)}function x(A){if(A>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return A|0}function k(A){return+A!=A&&(A=0),a.alloc(+A)}a.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==a.prototype},a.compare=function(f,b){if(fe(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),fe(b,Uint8Array)&&(b=a.from(b,b.offset,b.byteLength)),!a.isBuffer(f)||!a.isBuffer(b))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===b)return 0;let j=f.length,te=b.length;for(let ue=0,ge=Math.min(j,te);ue<ge;++ue)if(f[ue]!==b[ue]){j=f[ue],te=b[ue];break}return j<te?-1:te<j?1:0},a.isEncoding=function(f){switch(String(f).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(f,b){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return a.alloc(0);let j;if(b===void 0)for(b=0,j=0;j<f.length;++j)b+=f[j].length;const te=a.allocUnsafe(b);let ue=0;for(j=0;j<f.length;++j){let ge=f[j];if(fe(ge,Uint8Array))ue+ge.length>te.length?(a.isBuffer(ge)||(ge=a.from(ge)),ge.copy(te,ue)):Uint8Array.prototype.set.call(te,ge,ue);else if(a.isBuffer(ge))ge.copy(te,ue);else throw new TypeError('"list" argument must be an Array of Buffers');ue+=ge.length}return te};function y(A,f){if(a.isBuffer(A))return A.length;if(ArrayBuffer.isView(A)||fe(A,ArrayBuffer))return A.byteLength;if(typeof A!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof A);const b=A.length,j=arguments.length>2&&arguments[2]===!0;if(!j&&b===0)return 0;let te=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return b;case"utf8":case"utf-8":return ve(A).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b*2;case"hex":return b>>>1;case"base64":return me(A).length;default:if(te)return j?-1:ve(A).length;f=(""+f).toLowerCase(),te=!0}}a.byteLength=y;function h(A,f,b){let j=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((b===void 0||b>this.length)&&(b=this.length),b<=0)||(b>>>=0,f>>>=0,b<=f))return"";for(A||(A="utf8");;)switch(A){case"hex":return re(this,f,b);case"utf8":case"utf-8":return D(this,f,b);case"ascii":return Y(this,f,b);case"latin1":case"binary":return B(this,f,b);case"base64":return R(this,f,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,f,b);default:if(j)throw new TypeError("Unknown encoding: "+A);A=(A+"").toLowerCase(),j=!0}}a.prototype._isBuffer=!0;function m(A,f,b){const j=A[f];A[f]=A[b],A[b]=j}a.prototype.swap16=function(){const f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let b=0;b<f;b+=2)m(this,b,b+1);return this},a.prototype.swap32=function(){const f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let b=0;b<f;b+=4)m(this,b,b+3),m(this,b+1,b+2);return this},a.prototype.swap64=function(){const f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let b=0;b<f;b+=8)m(this,b,b+7),m(this,b+1,b+6),m(this,b+2,b+5),m(this,b+3,b+4);return this},a.prototype.toString=function(){const f=this.length;return f===0?"":arguments.length===0?D(this,0,f):h.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(f){if(!a.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:a.compare(this,f)===0},a.prototype.inspect=function(){let f="";const b=i.INSPECT_MAX_BYTES;return f=this.toString("hex",0,b).replace(/(.{2})/g,"$1 ").trim(),this.length>b&&(f+=" ... "),"<Buffer "+f+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(f,b,j,te,ue){if(fe(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(b===void 0&&(b=0),j===void 0&&(j=f?f.length:0),te===void 0&&(te=0),ue===void 0&&(ue=this.length),b<0||j>f.length||te<0||ue>this.length)throw new RangeError("out of range index");if(te>=ue&&b>=j)return 0;if(te>=ue)return-1;if(b>=j)return 1;if(b>>>=0,j>>>=0,te>>>=0,ue>>>=0,this===f)return 0;let ge=ue-te,Pe=j-b;const nt=Math.min(ge,Pe),Je=this.slice(te,ue),Ye=f.slice(b,j);for(let Xe=0;Xe<nt;++Xe)if(Je[Xe]!==Ye[Xe]){ge=Je[Xe],Pe=Ye[Xe];break}return ge<Pe?-1:Pe<ge?1:0};function T(A,f,b,j,te){if(A.length===0)return-1;if(typeof b=="string"?(j=b,b=0):b>2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b=+b,Ve(b)&&(b=te?0:A.length-1),b<0&&(b=A.length+b),b>=A.length){if(te)return-1;b=A.length-1}else if(b<0)if(te)b=0;else return-1;if(typeof f=="string"&&(f=a.from(f,j)),a.isBuffer(f))return f.length===0?-1:N(A,f,b,j,te);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?te?Uint8Array.prototype.indexOf.call(A,f,b):Uint8Array.prototype.lastIndexOf.call(A,f,b):N(A,[f],b,j,te);throw new TypeError("val must be string, number or Buffer")}function N(A,f,b,j,te){let ue=1,ge=A.length,Pe=f.length;if(j!==void 0&&(j=String(j).toLowerCase(),j==="ucs2"||j==="ucs-2"||j==="utf16le"||j==="utf-16le")){if(A.length<2||f.length<2)return-1;ue=2,ge/=2,Pe/=2,b/=2}function nt(Ye,Xe){return ue===1?Ye[Xe]:Ye.readUInt16BE(Xe*ue)}let Je;if(te){let Ye=-1;for(Je=b;Je<ge;Je++)if(nt(A,Je)===nt(f,Ye===-1?0:Je-Ye)){if(Ye===-1&&(Ye=Je),Je-Ye+1===Pe)return Ye*ue}else Ye!==-1&&(Je-=Je-Ye),Ye=-1}else for(b+Pe>ge&&(b=ge-Pe),Je=b;Je>=0;Je--){let Ye=!0;for(let Xe=0;Xe<Pe;Xe++)if(nt(A,Je+Xe)!==nt(f,Xe)){Ye=!1;break}if(Ye)return Je}return-1}a.prototype.includes=function(f,b,j){return this.indexOf(f,b,j)!==-1},a.prototype.indexOf=function(f,b,j){return T(this,f,b,j,!0)},a.prototype.lastIndexOf=function(f,b,j){return T(this,f,b,j,!1)};function C(A,f,b,j){b=Number(b)||0;const te=A.length-b;j?(j=Number(j),j>te&&(j=te)):j=te;const ue=f.length;j>ue/2&&(j=ue/2);let ge;for(ge=0;ge<j;++ge){const Pe=parseInt(f.substr(ge*2,2),16);if(Ve(Pe))return ge;A[b+ge]=Pe}return ge}function F(A,f,b,j){return Ee(ve(f,A.length-b),A,b,j)}function I(A,f,b,j){return Ee(xe(f),A,b,j)}function O(A,f,b,j){return Ee(me(f),A,b,j)}function U(A,f,b,j){return Ee(ie(f,A.length-b),A,b,j)}a.prototype.write=function(f,b,j,te){if(b===void 0)te="utf8",j=this.length,b=0;else if(j===void 0&&typeof b=="string")te=b,j=this.length,b=0;else if(isFinite(b))b=b>>>0,isFinite(j)?(j=j>>>0,te===void 0&&(te="utf8")):(te=j,j=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ue=this.length-b;if((j===void 0||j>ue)&&(j=ue),f.length>0&&(j<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");let ge=!1;for(;;)switch(te){case"hex":return C(this,f,b,j);case"utf8":case"utf-8":return F(this,f,b,j);case"ascii":case"latin1":case"binary":return I(this,f,b,j);case"base64":return O(this,f,b,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,f,b,j);default:if(ge)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),ge=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(A,f,b){return f===0&&b===A.length?e.fromByteArray(A):e.fromByteArray(A.slice(f,b))}function D(A,f,b){b=Math.min(A.length,b);const j=[];let te=f;for(;te<b;){const ue=A[te];let ge=null,Pe=ue>239?4:ue>223?3:ue>191?2:1;if(te+Pe<=b){let nt,Je,Ye,Xe;switch(Pe){case 1:ue<128&&(ge=ue);break;case 2:nt=A[te+1],(nt&192)===128&&(Xe=(ue&31)<<6|nt&63,Xe>127&&(ge=Xe));break;case 3:nt=A[te+1],Je=A[te+2],(nt&192)===128&&(Je&192)===128&&(Xe=(ue&15)<<12|(nt&63)<<6|Je&63,Xe>2047&&(Xe<55296||Xe>57343)&&(ge=Xe));break;case 4:nt=A[te+1],Je=A[te+2],Ye=A[te+3],(nt&192)===128&&(Je&192)===128&&(Ye&192)===128&&(Xe=(ue&15)<<18|(nt&63)<<12|(Je&63)<<6|Ye&63,Xe>65535&&Xe<1114112&&(ge=Xe))}}ge===null?(ge=65533,Pe=1):ge>65535&&(ge-=65536,j.push(ge>>>10&1023|55296),ge=56320|ge&1023),j.push(ge),te+=Pe}return $(j)}const Q=4096;function $(A){const f=A.length;if(f<=Q)return String.fromCharCode.apply(String,A);let b="",j=0;for(;j<f;)b+=String.fromCharCode.apply(String,A.slice(j,j+=Q));return b}function Y(A,f,b){let j="";b=Math.min(A.length,b);for(let te=f;te<b;++te)j+=String.fromCharCode(A[te]&127);return j}function B(A,f,b){let j="";b=Math.min(A.length,b);for(let te=f;te<b;++te)j+=String.fromCharCode(A[te]);return j}function re(A,f,b){const j=A.length;(!f||f<0)&&(f=0),(!b||b<0||b>j)&&(b=j);let te="";for(let ue=f;ue<b;++ue)te+=kt[A[ue]];return te}function S(A,f,b){const j=A.slice(f,b);let te="";for(let ue=0;ue<j.length-1;ue+=2)te+=String.fromCharCode(j[ue]+j[ue+1]*256);return te}a.prototype.slice=function(f,b){const j=this.length;f=~~f,b=b===void 0?j:~~b,f<0?(f+=j,f<0&&(f=0)):f>j&&(f=j),b<0?(b+=j,b<0&&(b=0)):b>j&&(b=j),b<f&&(b=f);const te=this.subarray(f,b);return Object.setPrototypeOf(te,a.prototype),te};function H(A,f,b){if(A%1!==0||A<0)throw new RangeError("offset is not uint");if(A+f>b)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(f,b,j){f=f>>>0,b=b>>>0,j||H(f,b,this.length);let te=this[f],ue=1,ge=0;for(;++ge<b&&(ue*=256);)te+=this[f+ge]*ue;return te},a.prototype.readUintBE=a.prototype.readUIntBE=function(f,b,j){f=f>>>0,b=b>>>0,j||H(f,b,this.length);let te=this[f+--b],ue=1;for(;b>0&&(ue*=256);)te+=this[f+--b]*ue;return te},a.prototype.readUint8=a.prototype.readUInt8=function(f,b){return f=f>>>0,b||H(f,1,this.length),this[f]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(f,b){return f=f>>>0,b||H(f,2,this.length),this[f]|this[f+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(f,b){return f=f>>>0,b||H(f,2,this.length),this[f]<<8|this[f+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(f,b){return f=f>>>0,b||H(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(f,b){return f=f>>>0,b||H(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},a.prototype.readBigUInt64LE=Ue(function(f){f=f>>>0,M(f,"offset");const b=this[f],j=this[f+7];(b===void 0||j===void 0)&&K(f,this.length-8);const te=b+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,ue=this[++f]+this[++f]*2**8+this[++f]*2**16+j*2**24;return BigInt(te)+(BigInt(ue)<<BigInt(32))}),a.prototype.readBigUInt64BE=Ue(function(f){f=f>>>0,M(f,"offset");const b=this[f],j=this[f+7];(b===void 0||j===void 0)&&K(f,this.length-8);const te=b*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],ue=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+j;return(BigInt(te)<<BigInt(32))+BigInt(ue)}),a.prototype.readIntLE=function(f,b,j){f=f>>>0,b=b>>>0,j||H(f,b,this.length);let te=this[f],ue=1,ge=0;for(;++ge<b&&(ue*=256);)te+=this[f+ge]*ue;return ue*=128,te>=ue&&(te-=Math.pow(2,8*b)),te},a.prototype.readIntBE=function(f,b,j){f=f>>>0,b=b>>>0,j||H(f,b,this.length);let te=b,ue=1,ge=this[f+--te];for(;te>0&&(ue*=256);)ge+=this[f+--te]*ue;return ue*=128,ge>=ue&&(ge-=Math.pow(2,8*b)),ge},a.prototype.readInt8=function(f,b){return f=f>>>0,b||H(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},a.prototype.readInt16LE=function(f,b){f=f>>>0,b||H(f,2,this.length);const j=this[f]|this[f+1]<<8;return j&32768?j|4294901760:j},a.prototype.readInt16BE=function(f,b){f=f>>>0,b||H(f,2,this.length);const j=this[f+1]|this[f]<<8;return j&32768?j|4294901760:j},a.prototype.readInt32LE=function(f,b){return f=f>>>0,b||H(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},a.prototype.readInt32BE=function(f,b){return f=f>>>0,b||H(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},a.prototype.readBigInt64LE=Ue(function(f){f=f>>>0,M(f,"offset");const b=this[f],j=this[f+7];(b===void 0||j===void 0)&&K(f,this.length-8);const te=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(j<<24);return(BigInt(te)<<BigInt(32))+BigInt(b+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),a.prototype.readBigInt64BE=Ue(function(f){f=f>>>0,M(f,"offset");const b=this[f],j=this[f+7];(b===void 0||j===void 0)&&K(f,this.length-8);const te=(b<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(te)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+j)}),a.prototype.readFloatLE=function(f,b){return f=f>>>0,b||H(f,4,this.length),t.read(this,f,!0,23,4)},a.prototype.readFloatBE=function(f,b){return f=f>>>0,b||H(f,4,this.length),t.read(this,f,!1,23,4)},a.prototype.readDoubleLE=function(f,b){return f=f>>>0,b||H(f,8,this.length),t.read(this,f,!0,52,8)},a.prototype.readDoubleBE=function(f,b){return f=f>>>0,b||H(f,8,this.length),t.read(this,f,!1,52,8)};function ee(A,f,b,j,te,ue){if(!a.isBuffer(A))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>te||f<ue)throw new RangeError('"value" argument is out of bounds');if(b+j>A.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(f,b,j,te){if(f=+f,b=b>>>0,j=j>>>0,!te){const Pe=Math.pow(2,8*j)-1;ee(this,f,b,j,Pe,0)}let ue=1,ge=0;for(this[b]=f&255;++ge<j&&(ue*=256);)this[b+ge]=f/ue&255;return b+j},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(f,b,j,te){if(f=+f,b=b>>>0,j=j>>>0,!te){const Pe=Math.pow(2,8*j)-1;ee(this,f,b,j,Pe,0)}let ue=j-1,ge=1;for(this[b+ue]=f&255;--ue>=0&&(ge*=256);)this[b+ue]=f/ge&255;return b+j},a.prototype.writeUint8=a.prototype.writeUInt8=function(f,b,j){return f=+f,b=b>>>0,j||ee(this,f,b,1,255,0),this[b]=f&255,b+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(f,b,j){return f=+f,b=b>>>0,j||ee(this,f,b,2,65535,0),this[b]=f&255,this[b+1]=f>>>8,b+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(f,b,j){return f=+f,b=b>>>0,j||ee(this,f,b,2,65535,0),this[b]=f>>>8,this[b+1]=f&255,b+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(f,b,j){return f=+f,b=b>>>0,j||ee(this,f,b,4,4294967295,0),this[b+3]=f>>>24,this[b+2]=f>>>16,this[b+1]=f>>>8,this[b]=f&255,b+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(f,b,j){return f=+f,b=b>>>0,j||ee(this,f,b,4,4294967295,0),this[b]=f>>>24,this[b+1]=f>>>16,this[b+2]=f>>>8,this[b+3]=f&255,b+4};function J(A,f,b,j,te){_e(f,j,te,A,b,7);let ue=Number(f&BigInt(4294967295));A[b++]=ue,ue=ue>>8,A[b++]=ue,ue=ue>>8,A[b++]=ue,ue=ue>>8,A[b++]=ue;let ge=Number(f>>BigInt(32)&BigInt(4294967295));return A[b++]=ge,ge=ge>>8,A[b++]=ge,ge=ge>>8,A[b++]=ge,ge=ge>>8,A[b++]=ge,b}function he(A,f,b,j,te){_e(f,j,te,A,b,7);let ue=Number(f&BigInt(4294967295));A[b+7]=ue,ue=ue>>8,A[b+6]=ue,ue=ue>>8,A[b+5]=ue,ue=ue>>8,A[b+4]=ue;let ge=Number(f>>BigInt(32)&BigInt(4294967295));return A[b+3]=ge,ge=ge>>8,A[b+2]=ge,ge=ge>>8,A[b+1]=ge,ge=ge>>8,A[b]=ge,b+8}a.prototype.writeBigUInt64LE=Ue(function(f,b=0){return J(this,f,b,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Ue(function(f,b=0){return he(this,f,b,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(f,b,j,te){if(f=+f,b=b>>>0,!te){const nt=Math.pow(2,8*j-1);ee(this,f,b,j,nt-1,-nt)}let ue=0,ge=1,Pe=0;for(this[b]=f&255;++ue<j&&(ge*=256);)f<0&&Pe===0&&this[b+ue-1]!==0&&(Pe=1),this[b+ue]=(f/ge>>0)-Pe&255;return b+j},a.prototype.writeIntBE=function(f,b,j,te){if(f=+f,b=b>>>0,!te){const nt=Math.pow(2,8*j-1);ee(this,f,b,j,nt-1,-nt)}let ue=j-1,ge=1,Pe=0;for(this[b+ue]=f&255;--ue>=0&&(ge*=256);)f<0&&Pe===0&&this[b+ue+1]!==0&&(Pe=1),this[b+ue]=(f/ge>>0)-Pe&255;return b+j},a.prototype.writeInt8=function(f,b,j){return f=+f,b=b>>>0,j||ee(this,f,b,1,127,-128),f<0&&(f=255+f+1),this[b]=f&255,b+1},a.prototype.writeInt16LE=function(f,b,j){return f=+f,b=b>>>0,j||ee(this,f,b,2,32767,-32768),this[b]=f&255,this[b+1]=f>>>8,b+2},a.prototype.writeInt16BE=function(f,b,j){return f=+f,b=b>>>0,j||ee(this,f,b,2,32767,-32768),this[b]=f>>>8,this[b+1]=f&255,b+2},a.prototype.writeInt32LE=function(f,b,j){return f=+f,b=b>>>0,j||ee(this,f,b,4,2147483647,-2147483648),this[b]=f&255,this[b+1]=f>>>8,this[b+2]=f>>>16,this[b+3]=f>>>24,b+4},a.prototype.writeInt32BE=function(f,b,j){return f=+f,b=b>>>0,j||ee(this,f,b,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[b]=f>>>24,this[b+1]=f>>>16,this[b+2]=f>>>8,this[b+3]=f&255,b+4},a.prototype.writeBigInt64LE=Ue(function(f,b=0){return J(this,f,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Ue(function(f,b=0){return he(this,f,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function W(A,f,b,j,te,ue){if(b+j>A.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("Index out of range")}function G(A,f,b,j,te){return f=+f,b=b>>>0,te||W(A,f,b,4),t.write(A,f,b,j,23,4),b+4}a.prototype.writeFloatLE=function(f,b,j){return G(this,f,b,!0,j)},a.prototype.writeFloatBE=function(f,b,j){return G(this,f,b,!1,j)};function X(A,f,b,j,te){return f=+f,b=b>>>0,te||W(A,f,b,8),t.write(A,f,b,j,52,8),b+8}a.prototype.writeDoubleLE=function(f,b,j){return X(this,f,b,!0,j)},a.prototype.writeDoubleBE=function(f,b,j){return X(this,f,b,!1,j)},a.prototype.copy=function(f,b,j,te){if(!a.isBuffer(f))throw new TypeError("argument should be a Buffer");if(j||(j=0),!te&&te!==0&&(te=this.length),b>=f.length&&(b=f.length),b||(b=0),te>0&&te<j&&(te=j),te===j||f.length===0||this.length===0)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(j<0||j>=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),f.length-b<te-j&&(te=f.length-b+j);const ue=te-j;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(b,j,te):Uint8Array.prototype.set.call(f,this.subarray(j,te),b),ue},a.prototype.fill=function(f,b,j,te){if(typeof f=="string"){if(typeof b=="string"?(te=b,b=0,j=this.length):typeof j=="string"&&(te=j,j=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!a.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(f.length===1){const ge=f.charCodeAt(0);(te==="utf8"&&ge<128||te==="latin1")&&(f=ge)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(b<0||this.length<b||this.length<j)throw new RangeError("Out of range index");if(j<=b)return this;b=b>>>0,j=j===void 0?this.length:j>>>0,f||(f=0);let ue;if(typeof f=="number")for(ue=b;ue<j;++ue)this[ue]=f;else{const ge=a.isBuffer(f)?f:a.from(f,te),Pe=ge.length;if(Pe===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(ue=0;ue<j-b;++ue)this[ue+b]=ge[ue%Pe]}return this};const z={};function ne(A,f,b){z[A]=class extends b{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${A}]`,this.stack,delete this.name}get code(){return A}set code(te){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:te,writable:!0})}toString(){return`${this.name} [${A}]: ${this.message}`}}}ne("ERR_BUFFER_OUT_OF_BOUNDS",function(A){return A?`${A} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ne("ERR_INVALID_ARG_TYPE",function(A,f){return`The "${A}" argument must be of type number. Received type ${typeof f}`},TypeError),ne("ERR_OUT_OF_RANGE",function(A,f,b){let j=`The value of "${A}" is out of range.`,te=b;return Number.isInteger(b)&&Math.abs(b)>2**32?te=se(String(b)):typeof b=="bigint"&&(te=String(b),(b>BigInt(2)**BigInt(32)||b<-(BigInt(2)**BigInt(32)))&&(te=se(te)),te+="n"),j+=` It must be ${f}. Received ${te}`,j},RangeError);function se(A){let f="",b=A.length;const j=A[0]==="-"?1:0;for(;b>=j+4;b-=3)f=`_${A.slice(b-3,b)}${f}`;return`${A.slice(0,b)}${f}`}function ye(A,f,b){M(f,"offset"),(A[f]===void 0||A[f+b]===void 0)&&K(f,A.length-(b+1))}function _e(A,f,b,j,te,ue){if(A>b||A<f){const ge=typeof f=="bigint"?"n":"";let Pe;throw f===0||f===BigInt(0)?Pe=`>= 0${ge} and < 2${ge} ** ${(ue+1)*8}${ge}`:Pe=`>= -(2${ge} ** ${(ue+1)*8-1}${ge}) and < 2 ** ${(ue+1)*8-1}${ge}`,new z.ERR_OUT_OF_RANGE("value",Pe,A)}ye(j,te,ue)}function M(A,f){if(typeof A!="number")throw new z.ERR_INVALID_ARG_TYPE(f,"number",A)}function K(A,f,b){throw Math.floor(A)!==A?(M(A,b),new z.ERR_OUT_OF_RANGE("offset","an integer",A)):f<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${f}`,A)}const ce=/[^+/0-9A-Za-z-_]/g;function be(A){if(A=A.split("=")[0],A=A.trim().replace(ce,""),A.length<2)return"";for(;A.length%4!==0;)A=A+"=";return A}function ve(A,f){f=f||1/0;let b;const j=A.length;let te=null;const ue=[];for(let ge=0;ge<j;++ge){if(b=A.charCodeAt(ge),b>55295&&b<57344){if(!te){if(b>56319){(f-=3)>-1&&ue.push(239,191,189);continue}else if(ge+1===j){(f-=3)>-1&&ue.push(239,191,189);continue}te=b;continue}if(b<56320){(f-=3)>-1&&ue.push(239,191,189),te=b;continue}b=(te-55296<<10|b-56320)+65536}else te&&(f-=3)>-1&&ue.push(239,191,189);if(te=null,b<128){if((f-=1)<0)break;ue.push(b)}else if(b<2048){if((f-=2)<0)break;ue.push(b>>6|192,b&63|128)}else if(b<65536){if((f-=3)<0)break;ue.push(b>>12|224,b>>6&63|128,b&63|128)}else if(b<1114112){if((f-=4)<0)break;ue.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw new Error("Invalid code point")}return ue}function xe(A){const f=[];for(let b=0;b<A.length;++b)f.push(A.charCodeAt(b)&255);return f}function ie(A,f){let b,j,te;const ue=[];for(let ge=0;ge<A.length&&!((f-=2)<0);++ge)b=A.charCodeAt(ge),j=b>>8,te=b%256,ue.push(te),ue.push(j);return ue}function me(A){return e.toByteArray(be(A))}function Ee(A,f,b,j){let te;for(te=0;te<j&&!(te+b>=f.length||te>=A.length);++te)f[te+b]=A[te];return te}function fe(A,f){return A instanceof f||A!=null&&A.constructor!=null&&A.constructor.name!=null&&A.constructor.name===f.name}function Ve(A){return A!==A}const kt=function(){const A="0123456789abcdef",f=new Array(256);for(let b=0;b<16;++b){const j=b*16;for(let te=0;te<16;++te)f[j+te]=A[b]+A[te]}return f}();function Ue(A){return typeof BigInt>"u"?Nt:A}function Nt(){throw new Error("BigInt not supported")}}(ra)),ra}var Nm=sr();const Un="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Vn="http://www.w3.org/2001/XMLSchema#",Qs="http://www.w3.org/2000/10/swap/",Lt={xsd:{decimal:`${Vn}decimal`,boolean:`${Vn}boolean`,double:`${Vn}double`,integer:`${Vn}integer`,string:`${Vn}string`},rdf:{type:`${Un}type`,nil:`${Un}nil`,first:`${Un}first`,rest:`${Un}rest`,langString:`${Un}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Qs}reify#forSome`,forAll:`${Qs}reify#forAll`},log:{implies:`${Qs}log#implies`,isImpliedBy:`${Qs}log#isImpliedBy`}},{xsd:Ys}=Lt,Dm=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Ad={"\\":"\\","'":"'",'"':'"',n:`
7
+ `,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Lm=/[\x00-\x20<>\\"\{\}\|\^\`]/,Om={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Pm=/$0^/;class Mm{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 Om)&&this[t]instanceof RegExp&&(this[t]=Pm)}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,c;for(;a=this._newline.exec(r);)this.comments&&(c=this._comment.exec(a[0]))&&s("comment",c[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&&(c=this._comment.exec(r))&&s("comment",c[1],"",this._line,r.length),r=null,s("eof","","",this._line,0)),this._input=r;const l=this._line,d=r[0];let u="",p="",g="",v=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,u="^");break}case"<":if(v=this._unescapedIri.exec(r))u="IRI",p=v[1];else if(v=this._iri.exec(r)){if(p=this._unescape(v[1]),p===null||Lm.test(p))return o(this);u="IRI"}else r.length>1&&r[1]==="<"?(u="<<",_=2):this._n3Mode&&r.length>1&&r[1]==="="&&(_=2,this._isImpliedBy?(u="abbreviation",p="<"):(u="inverse",p=">"));break;case">":r.length>1&&r[1]===">"&&(u=">>",_=2);break;case"_":((v=this._blank.exec(r))||t&&(v=this._blank.exec(`${r} `)))&&(u="blank",g="_",p=v[1]);break;case'"':if(v=this._simpleQuotedString.exec(r))p=v[1];else if({value:p,matchLength:_}=this._parseLiteral(r),p===null)return o(this);(v!==null||_!==0)&&(u="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(v=this._simpleApostropheString.exec(r))p=v[1];else if({value:p,matchLength:_}=this._parseLiteral(r),p===null)return o(this);(v!==null||_!==0)&&(u="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(v=this._variable.exec(r))&&(u="var",p=v[0]);break;case"@":this._previousMarker==="literal"&&(v=this._langcode.exec(r))?(u="langcode",p=v[1]):(v=this._keyword.exec(r))&&(u=v[0]);break;case".":if(r.length===1?t:r[1]<"0"||r[1]>"9"){u=".",_=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(v=this._number.exec(r)||t&&(v=this._number.exec(`${r} `)))&&(u="literal",p=v[0],g=typeof v[1]=="string"?Ys.double:typeof v[2]=="string"?Ys.decimal:Ys.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(v=this._sparqlKeyword.exec(r))?u=v[0].toUpperCase():E=!0;break;case"f":case"t":(v=this._boolean.exec(r))?(u="literal",p=v[0],g=Ys.boolean):E=!0;break;case"a":(v=this._shortPredicates.exec(r))?(u="abbreviation",p="a"):E=!0;break;case"=":this._n3Mode&&r.length>1&&(u="abbreviation",r[1]!==">"?(_=1,p="="):(_=2,p=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(_=1,u=d);break;case"{":!this._lineMode&&r.length>=2&&(r[1]==="|"?(u="{|",_=2):(u=d,_=1));break;case"|":r.length>=2&&r[1]==="}"&&(u="|}",_=2);break;default:E=!0}if(E&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(v=this._prefix.exec(r))?(u="prefix",p=v[1]||""):((v=this._prefixed.exec(r))||t&&(v=this._prefixed.exec(`${r} `)))&&(u="prefixed",g=v[1]||"",p=this._unescape(v[2]))),this._previousMarker==="^^")switch(u){case"prefixed":u="type";break;case"IRI":u="typeIRI";break;default:u=""}if(!u)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const x=_||v[0].length,k=s(u,p,g,l,x);this.previousToken=k,this._previousMarker=u,r=r.substr(x,r.length)}function s(a,c,l,d,u){const p=r?n-r.length:n,g=p+u,v={type:a,value:c,prefix:l,line:d,start:p,end:g};return e(null,v),v}function o(a){e(a._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(Dm,(n,s,o,a)=>{if(typeof s=="string")return String.fromCharCode(Number.parseInt(s,16));if(typeof o=="string"){let c=Number.parseInt(o,16);return c<=65535?String.fromCharCode(Number.parseInt(o,16)):String.fromCharCode(55296+((c-=65536)>>10),56320+(c&1023))}return a in Ad?Ad[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,c=n+r;if(r===1&&a!==0||r===3&&this._lineMode)break;return this._line+=a,{value:this._unescape(o),matchLength:c}}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=Nm.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:Fm,xsd:Mr}=Lt;let Cn,jm=0;const He={namedNode:jf,blankNode:Bf,variable:Uf,literal:qf,defaultGraph:Vm,quad:Jl,triple:Jl,fromTerm:hs,fromQuad:Vf};class Ni{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Ni?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 Mo=class extends Ni{get termType(){return"NamedNode"}},yi=class Ff extends Ni{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 Mo(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!=="@"?Mr.string:Fm.langString}equals(e){return e instanceof Ff?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}}}},Bm=class extends Ni{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},qm=class extends Ni{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},Um=class extends Ni{constructor(){return super(""),Cn||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};Cn=new Um;function us(i,e,t){if(e=e||He,!i)return e.defaultGraph();switch(i[0]){case"?":return e.variable(i.substr(1));case"_":return e.blankNode(i.substr(2));case'"':if(e===He)return new yi(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(us(i[0],e,!0),us(i[1],e,!0),us(i[2],e,!0),i[3]&&us(i[3],e,!0))}function dn(i,e){if(typeof i=="string")return i;if(i instanceof Ni&&i.termType!=="Quad")return i.id;if(!i)return Cn.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!==Mr.string?`^^${i.datatype.value}`:""}`;case"Quad":const t=[dn(i.subject,!0),dn(i.predicate,!0),dn(i.object,!0)];return i.graph&&i.graph.termType!=="DefaultGraph"&&t.push(dn(i.graph,!0)),e?t:JSON.stringify(t);default:throw new Error(`Unexpected termType: ${i.termType}`)}}let Fo=class extends Ni{constructor(e,t,r,n){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=n||Cn}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 jf(i){return new Mo(i)}function Bf(i){return new Bm(i||`n3-${jm++}`)}function qf(i,e){if(typeof e=="string")return new yi(`"${i}"@${e.toLowerCase()}`);let t=e?e.value:"";return t===""&&(typeof i=="boolean"?t=Mr.boolean:typeof i=="number"&&(Number.isFinite(i)?t=Number.isInteger(i)?Mr.integer:Mr.double:(t=Mr.double,Number.isNaN(i)||(i=i>0?"INF":"-INF")))),t===""||t===Mr.string?new yi(`"${i}"`):new yi(`"${i}"^^${t}`)}function Uf(i){return new qm(i)}function Vm(){return Cn}function Jl(i,e,t,r){return new Fo(i,e,t,r)}function hs(i){if(i instanceof Ni)return i;switch(i.termType){case"NamedNode":return jf(i.value);case"BlankNode":return Bf(i.value);case"Variable":return Uf(i.value);case"DefaultGraph":return Cn;case"Literal":return qf(i.value,i.language||i.datatype);case"Quad":return Vf(i);default:throw new Error(`Unexpected termType: ${i.termType}`)}}function Vf(i){if(i instanceof Fo)return i;if(i.termType!=="Quad")throw new Error(`Unexpected termType: ${i.termType}`);return Jl(hs(i.subject),hs(i.predicate),hs(i.object),hs(i.graph))}let Nd=0;class zf{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&Hf(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),c=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),c&&(this._resolveRelativeIRI=l=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Mm({lineMode:c,n3:a,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Nd=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=Zs}_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${Nd++}_`,this._prefixCallback=s||Zs,this._inversePredicate=!1,this._quantified=Object.create(null),!n){const c=[];let l;if(this._callback=(d,u)=>{d?l=d:u&&c.push(u)},this._lexer.tokenize(e).every(d=>this._readCallback=this._readCallback(d)),l)throw l;return c}let a=(c,l)=>{c!==null?(this._callback(c),this._callback=Zs):this._readCallback&&(this._readCallback=this._readCallback(l))};o&&(this._lexer.comments=!0,a=(c,l)=>{c!==null?(this._callback(c),this._callback=Zs):this._readCallback&&(l.type==="comment"?o(l.value):this._readCallback=this._readCallback(l))}),this._callback=n,this._lexer.tokenize(e,a)}}function Zs(){}function Hf(i,e){i._factory=e,i.DEFAULTGRAPH=e.defaultGraph(),i.RDF_FIRST=e.namedNode(Lt.rdf.first),i.RDF_REST=e.namedNode(Lt.rdf.rest),i.RDF_NIL=e.namedNode(Lt.rdf.nil),i.N3_FORALL=e.namedNode(Lt.r.forAll),i.N3_FORSOME=e.namedNode(Lt.r.forSome),i.ABBREVIATIONS={a:e.namedNode(Lt.rdf.type),"=":e.namedNode(Lt.owl.sameAs),">":e.namedNode(Lt.log.implies),"<":e.namedNode(Lt.log.isImpliedBy)},i.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}Hf(zf.prototype,He);function Ql(i){return!!i&&i.termType==="DefaultGraph"}function ho(i){return i.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const zm=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,Hm=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,Dd="./",Wm="../",na="?",Ld="#";class Ac{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!zm.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!Ac.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",ho(e)],r=[],n=[],s=/[^/?#]*([/?#])/y;let o,a=0,c=0,l=s.lastIndex=e.length;for(;!a&&!c&&(o=s.exec(this.base));)o[1]===Ld?c=s.lastIndex-1:(t.push(ho(o[0]),"(?:"),r.push(")?"),o[1]!==na?n.push(l=s.lastIndex):(a=l=s.lastIndex,c=this.base.indexOf(Ld,a),this._pathReplacements[a]=na));for(let d=0;d<n.length;d++)this._pathReplacements[n[d]]=Wm.repeat(n.length-d-1);return this._pathReplacements[n[n.length-1]]=Dd,this._baseLength=c>0?c:this.base.length,t.push(ho(this.base.substring(l,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!==na&&!Hm.test(s)?e:n===Dd&&/^[^?#]/.test(s)?s:n+s}return e.substring(r-1)}}const zn=He.defaultGraph(),{rdf:Gm,xsd:nn}=Lt,Od=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Pd=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Km={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class Hn extends Ni{equals(e){return e===this}}class Nc{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=zn,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new Ac(t.baseIRI)))}get _inDefaultGraph(){return zn.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
8
  `:`
9
9
  }
10
- `)+(bn.equals(n)?"":`${this._encodeIriOrBlank(n)} {
10
+ `)+(zn.equals(n)?"":`${this._encodeIriOrBlank(n)} {
11
11
  `)),this._graph=n,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,s):this._write(`;
12
12
  ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,s):this._write(`${(this._subject===null?"":`.
13
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
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)),pd.test(t)&&(t=t.replace(md,gd));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(pd.test(t)&&(t=t.replace(md,gd)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===Dr.string)return`"${t}"`}else switch(e.datatype.value){case Dr.string:return`"${t}"`;case Dr.boolean:if(t==="true"||t==="false")return t;break;case Dr.integer:if(/^[+-]?\d+$/.test(t))return t;break;case Dr.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case Dr.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t;break}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===fm.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)}${xl(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?`.
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)),Od.test(t)&&(t=t.replace(Pd,Md));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(Od.test(t)&&(t=t.replace(Pd,Md)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===nn.string)return`"${t}"`}else switch(e.datatype.value){case nn.string:return`"${t}"`;case nn.boolean:if(t==="true"||t==="false")return t;break;case nn.integer:if(/^[+-]?\d+$/.test(t))return t;break;case nn.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case nn.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)}${Ql(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,zn,n):this._writeQuad(e,t,r,n||zn,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
16
  `:`
17
17
  }
18
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=Ds(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?`;
19
+ `)}if(r){let n="",s="";for(const o in this._prefixIRIs)n+=n?`|${o}`:o,s+=(s?"|":"")+this._prefixIRIs[o];n=ho(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 Hn("[]");case 1:if(n=r[0],!(n.object instanceof Hn))return new Hn(`[ ${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
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?`.
22
+ `)+this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)}`,e=n.predicate);return new Hn(`${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 Hn(`(${r.join(" ")})`)}end(e){this._subject!==null&&(this._write(this._inDefaultGraph?`.
24
24
  `:`
25
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 gd(i){let e=pm[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 Lo={exports:{}},Do={exports:{}},Oo,yd;function nt(){if(yd)return Oo;yd=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 Oo={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},Oo}var Mo={exports:{}},Po,bd;function uf(){return bd||(bd=1,Po={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"{}"}}}),Po}var jo,vd;function Pt(){if(vd)return jo;vd=1;const{format:i,inspect:e}=uf(),{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),jo={AbortError:_,aggregateTwoErrors:y(b),hideStackFrames:y,codes:l},jo}var wn={exports:{}},wd;function es(){if(wd)return wn.exports;wd=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 Ss={exports:{}},_d;function ao(){if(_d)return Ss.exports;_d=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)}Ss.exports=s,Ss.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 Ss.exports}var xd;function Ut(){return xd||(xd=1,function(i){const e=Hi(),{format:t,inspect:r}=uf(),{codes:{ERR_INVALID_ARG_TYPE:n}}=Pt(),{kResistStopPropagation:s,AggregateError:o,SymbolDispose:a}=nt(),l=globalThis.AbortSignal||es().AbortSignal,c=globalThis.AbortController||es().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:ao().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")}(Mo)),Mo.exports}var ks={},Bo,Ed;function hs(){if(Ed)return Bo;Ed=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 X(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)}),X=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,St=>typeof St=="string"?`'${St}'`:f(St)),", ");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 Bo={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:X,validateUndefined:G,validateUnion:oe,validateAbortSignal:ge,validateLinkHeaderValue:we},Bo}var Is={exports:{}},Fo={exports:{}},Sd;function $r(){if(Sd)return Fo.exports;Sd=1;var i=Fo.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},Fo.exports}var qo,kd;function Wi(){if(kd)return qo;kd=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?.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?.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?.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?.endEmitted!="boolean"?null:!!(Z.endEmitted||z===!1&&Z.ended===!0&&Z.length===0)}function $(x){return x&&x[s]!=null?x[s]:typeof 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?.writable!="boolean"?null:v(x)?!1:f(x)&&x.writable&&!u(x)}function R(x,z){return y(x)?v(x)?!0:!(z?.readable!==!1&&$(x)||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?.closed=="boolean"||typeof Z?.closed=="boolean"?z?.closed||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 X(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&&X(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 qo={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:X,willEmitClose:Y,isTransformStream:E},qo}var Id;function sr(){if(Id)return Is.exports;Id=1;const i=$r(),{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}=hs(),{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 X(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=X(F,te,H=>{z&&ce(),H?J(H):Z()})})}return Is.exports=X,Is.exports.finished=Y,Is.exports}var Uo,Rd;function an(){if(Rd)return Uo;Rd=1;const i=$r(),{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(X){y(this,e(X,R),P)}),this)}function y(R,P,q){let I=!1;function L(X){if(I)return;I=!0;const A=R._readableState,Y=R._writableState;f(X,Y,A),Y&&(Y.closed=!0),A&&(A.closed=!0),typeof q=="function"&&q(X),X?i.nextTick(b,R,X):i.nextTick(_,R)}try{R._destroy(P||null,L)}catch(X){L(X)}}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,X=R._writableState,A=X||L;L&&(L.constructed=!0),X&&(X.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?.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 Uo={construct:v,destroyer:j,destroy:g,undestroy:S,errorOrDestroy:k},Uo}var Vo,Td;function sc(){if(Td)return Vo;Td=1;const{ArrayIsArray:i,ObjectSetPrototypeOf:e}=nt(),{EventEmitter:t}=ao();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 Vo={Stream:r,prependListener:n},Vo}var zo={exports:{}},$d;function lo(){return $d||($d=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}}(zo)),zo.exports}var Ho,Cd;function mm(){if(Cd)return Ho;Cd=1;const{StringPrototypeSlice:i,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:r}=nt(),{Buffer:n}=Hi(),{inspect:s}=Ut();return Ho=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})}},Ho}var Wo,Ad;function co(){if(Ad)return Wo;Ad=1;const{MathFloor:i,NumberIsInteger:e}=nt(),{validateInteger:t}=hs(),{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 Wo={getHighWaterMark:c,getDefaultHighWaterMark:a,setDefaultHighWaterMark:l},Wo}var Go={},Rs={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Nd;function gm(){return Nd||(Nd=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)}}(Rs,Rs.exports)),Rs.exports}var Ld;function ym(){if(Ld)return Go;Ld=1;var i=gm().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}Go.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 Go}var Ko,Dd;function hf(){if(Dd)return Ko;Dd=1;const i=$r(),{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 Ko=a,Ko}var Jo,Od;function uo(){if(Od)return Jo;Od=1;const i=$r(),{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();Jo=ue,ue.ReadableState=ve;const{EventEmitter:y}=ao(),{Stream:b,prependListener:_}=sc(),{Buffer:E}=Hi(),{addAbortSignal:S}=lo(),k=sr();let v=Ut().debuglog("stream",M=>{v=M});const u=mm(),m=an(),{getHighWaterMark:T,getDefaultHighWaterMark:N}=co(),{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:X}=hs(),A=g("kPaused"),{StringDecoder:Y}=ym(),F=hf();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 Bi()),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 Bi();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 kt;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&&(kt=new j("chunk",["string","Buffer","Uint8Array"],U))),kt)x(M,kt);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;St(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?St(M,ke,U,!1):ee(M,ke)):St(M,ke,U,!1)}else xe||(ke.state&=~ce,ee(M,ke));return!ke.ended&&(ke.length<ke.highWaterMark||ke.length===0)}function St(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 Be=1073741824;function Ct(M){if(M>Be)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?Io(this):p(this),null;if(M=C(M,U),M===0&&U.ended)return U.length===0&&Io(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(kt){x(this,kt)}U.state&=~W,U.reading||(M=C(_e,U))}let ke;return M>0?ke=td(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&&Io(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 kt=(!U||U.end!==!1)&&M!==i.stdout&&M!==i.stderr?rd:pn;xe.endEmitted?i.nextTick(kt):_e.once("end",kt),M.on("unpipe",oi);function oi(fr,Mi){v("onunpipe"),fr===_e&&Mi&&Mi.hasUnpiped===!1&&(Mi.hasUnpiped=!0,Gp())}function rd(){v("onend"),M.end()}let hr,nd=!1;function Gp(){v("cleanup"),M.removeListener("close",$o),M.removeListener("finish",Co),hr&&M.removeListener("drain",hr),M.removeListener("error",To),M.removeListener("unpipe",oi),_e.removeListener("end",rd),_e.removeListener("end",pn),_e.removeListener("data",od),nd=!0,hr&&xe.awaitDrainWriters&&(!M._writableState||M._writableState.needDrain)&&hr()}function sd(){nd||(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",od);function od(fr){v("ondata");const Mi=M.write(fr);v("dest.write",Mi),Mi===!1&&sd()}function To(fr){if(v("onerror",fr),pn(),M.removeListener("error",To),M.listenerCount("error")===0){const Mi=M._writableState||M._readableState;Mi&&!Mi.errorEmitted?x(M,fr):M.emit("error",fr)}}_(M,"error",To);function $o(){M.removeListener("finish",Co),pn()}M.once("close",$o);function Co(){v("onfinish"),M.removeListener("close",$o),pn()}M.once("finish",Co);function pn(){v("unpipe"),_e.unpipe(M)}return M.emit("pipe",_e),M.writableNeedDrain===!0?sd():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 kt=0;kt<ke.length;kt++)ke[kt].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 ed(this)},ue.prototype.iterator=function(M){return M!==void 0&&X(M,"options"),ed(this,M)};function ed(M,U){typeof M.read!="function"&&(M=ue.wrap(M,{objectMode:!0}));const _e=zp(M,U);return _e.stream=M,_e}async function*zp(M,U){let _e=te;function xe(oi){this===M?(_e(),_e=te):_e=oi}M.on("readable",xe);let ke;const kt=k(M,{writable:!1},oi=>{ke=oi?$(ke,oi):null,_e(),_e=te});try{for(;;){const oi=M.destroyed?null:M.read();if(oi!==null)yield oi;else{if(ke)throw ke;if(ke===null)return;await new l(xe)}}}catch(oi){throw ke=$(ke,oi),ke}finally{(ke||U?.destroyOnReturn!==!1)&&(ke===void 0||M._readableState.autoDestroy)?m.destroyer(M,null):(M.off("readable",xe),kt())}}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=td;function td(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 Io(M){const U=M._readableState;v("endReadable",U.endEmitted),U.endEmitted||(U.ended=!0,i.nextTick(Hp,U,M))}function Hp(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(Wp,U);else if(M.autoDestroy){const _e=U._writableState;(!_e||_e.autoDestroy&&(_e.finished||_e.writable===!1))&&U.destroy()}}}function Wp(M){M.writable&&!M.writableEnded&&!M.destroyed&&M.end()}ue.from=function(M,U){return F(ue,M,U)};let Ro;function id(){return Ro===void 0&&(Ro={}),Ro}return ue.fromWeb=function(M,U){return id().newStreamReadableFromReadableStream(M,U)},ue.toWeb=function(M,U){return id().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,kt){m.destroyer(M,ke),kt(ke)}}).wrap(M)},Jo}var Qo,Md;function oc(){if(Md)return Qo;Md=1;const i=$r(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:n,ObjectDefineProperties:s,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:a,Symbol:l,SymbolHasInstance:c}=nt();Qo=X,X.WritableState=I;const{EventEmitter:d}=ao(),f=sc().Stream,{Buffer:g}=Hi(),y=an(),{addAbortSignal:b}=lo(),{getHighWaterMark:_,getDefaultHighWaterMark:E}=co(),{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(X.prototype,f.prototype),o(X,f);function P(){}const q=l("kOnFinished");function I(O,G,oe){typeof oe!="boolean"&&(oe=G instanceof Bi()),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 X(O){const G=this instanceof Bi();if(!G&&!r(X,this))return new X(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(X,c,{__proto__:null,value:function(O){return r(this,O)?!0:this!==X?!1:O&&O._writableState instanceof I}}),X.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))}X.prototype.write=function(O,G,oe){return A(this,O,G,oe)===!0},X.prototype.cork=function(){this._writableState.corked++},X.prototype.uncork=function(){const O=this._writableState;O.corked&&(O.corked--,O.writing||ce(this,O))},X.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}X.prototype._write=function(O,G,oe){if(this._writev)this._writev([{chunk:O,encoding:G}],oe);else throw new k("_write()")},X.prototype._writev=null,X.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(X.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;X.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},X.prototype._undestroy=y.undestroy,X.prototype._destroy=function(O,G){G(O)},X.prototype[d.captureRejectionSymbol]=function(O){this.destroy(O)};let ge;function be(){return ge===void 0&&(ge={}),ge}return X.fromWeb=function(O,G){return be().newStreamWritableFromWritableStream(O,G)},X.toWeb=function(O){return be().newWritableStreamFromStreamWritable(O)},Qo}var Xo,Pd;function bm(){if(Pd)return Xo;Pd=1;const i=$r(),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=Bi(),S=uo(),k=oc(),{createDeferredPromise:v}=Ut(),u=hf(),m=globalThis.Blob||e.Blob,T=typeof m<"u"?function(I){return I instanceof m}:function(I){return!1},N=globalThis.AbortController||es().AbortController,{FunctionPrototypeCall:$}=nt();class j extends E{constructor(I){super(I),I?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),I?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Xo=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?.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?.readable)&&d(I?.writable))return j.fromWeb(I);if(typeof I?.writable=="object"||typeof I?.readable=="object"){const A=I!=null&&I.readable?o(I?.readable)?I?.readable:q(I.readable):void 0,Y=I!=null&&I.writable?a(I?.writable)?I?.writable:q(I.writable):void 0;return P({readable:A,writable:Y})}const X=I?.then;if(typeof X=="function"){let A;return $(X,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 X=new N,A=X.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){X.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 X=!!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:X,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()}})),X&&(f(I,J=>{X=!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 Xo}var Yo,jd;function Bi(){if(jd)return Yo;jd=1;const{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:r}=nt();Yo=o;const n=uo(),s=oc();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=bm()),c(d,"body")},Yo}var Zo,Bd;function ff(){if(Bd)return Zo;Bd=1;const{ObjectSetPrototypeOf:i,Symbol:e}=nt();Zo=o;const{ERR_METHOD_NOT_IMPLEMENTED:t}=Pt().codes,r=Bi(),{getHighWaterMark:n}=co();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()}},Zo}var ea,Fd;function pf(){if(Fd)return ea;Fd=1;const{ObjectSetPrototypeOf:i}=nt();ea=t;const e=ff();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)},ea}var ta,qd;function ac(){if(qd)return ta;qd=1;const i=$r(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:r,SymbolDispose:n}=nt(),s=sr(),{once:o}=Ut(),a=an(),l=Bi(),{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}=hs(),{isIterable:k,isReadable:v,isReadableNodeStream:u,isNodeStream:m,isTransformStream:T,isWebStream:N,isReadableStream:$,isReadableFinished:j}=Wi(),R=globalThis.AbortController||es().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 X(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=uo()),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(X(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?.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(St=>St()),i.nextTick(ce,be,O))}}let we;for(let ve=0;ve<J.length;ve++){const ue=J[ve],Ve=ve<J.length-1,St=ve>0,Be=Ve||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(Be){const{destroy:h,cleanup:p}=L(ue,Ve,St);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=pf());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),Be&&C.end(),i.nextTick(pe)},ee=>{C.destroy(ee),i.nextTick(pe,ee)});else if(k(we,!0))oe++,F(we,C,pe,{end:Be});else if($(we)||T(we)){const ee=we.readable||we;oe++,F(ee,C,pe,{end:Be})}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:Be});v(ue)&&Ct&&re.push(C)}else if(T(we)||$(we)){const C=we.readable||we;oe++,F(C,ue,pe,{end:Be})}else if(k(we))oe++,F(we,ue,pe,{end:Be});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:Be});else if($(we)||k(we))oe++,te(we,ue,pe,{end:Be});else if(T(we))oe++,te(we.readable,ue,pe,{end:Be});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 ta={pipelineImpl:z,pipeline:x},ta}var ia,Ud;function mf(){if(Ud)return ia;Ud=1;const{pipeline:i}=ac(),e=Bi(),{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 ia=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,X,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(X){L(X)}}}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},ia}var Vd;function vm(){if(Vd)return ks;Vd=1;const i=globalThis.AbortController||es().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}=hs(),c=nt().Symbol("kWeak"),d=nt().Symbol("kResistStopPropagation"),{finished:f}=sr(),g=mf(),{addAbortSignalNoValidate:y}=lo(),{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?.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?.signal!=null&&o(re.signal,"options.signal");let ne=1;re?.concurrency!=null&&(ne=v(re.concurrency));let ge=ne-1;return 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?.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 St(){try{for await(let Be of G){if(ie)return;if(O.aborted)throw new s;try{if(Be=V(Be,pe),Be===P)continue;Be=$(Be)}catch(Ct){Be=N(Ct)}fe+=1,j(Be,ue,ve),oe.push(Be),ye&&(ye(),ye=null),!ie&&(oe.length>=ge||fe>=ne)&&await new T(Ct=>{we=Ct})}oe.push(q)}catch(Be){const Ct=N(Be);j(Ct,ue,ve),oe.push(Ct)}finally{ie=!0,ye&&(ye(),ye=null)}}St();try{for(;;){for(;oe.length>0;){const Be=await oe[0];if(Be===q)return;if(O.aborted)throw new s;Be!==P&&(yield Be),oe.shift(),Ve()}await new T(Be=>{ye=Be})}}finally{ie=!0,we&&(we(),we=null)}}).call(this)}function X(V=void 0){return V!=null&&l(V,"options"),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?.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?.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?.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?.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 ks.streamReturningOperators={asIndexedPairs:E(X,"readable.asIndexedPairs will be removed in a future version."),drop:W,filter:x,flatMap:ce,map:L,take:K,compose:I},ks.promiseReturningOperators={every:Y,forEach:te,reduce:Z,toArray:J,some:A,find:F},ks}var ra,zd;function gf(){if(zd)return ra;zd=1;const{ArrayPrototypePop:i,Promise:e}=nt(),{isIterable:t,isNodeStream:r,isWebStream:n}=Wi(),{pipelineImpl:s}=ac(),{finished:o}=sr();yf();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 ra={finished:o,pipeline:a},ra}var Hd;function yf(){if(Hd)return Do.exports;Hd=1;const{Buffer:i}=Hi(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:r}=nt(),{promisify:{custom:n}}=Ut(),{streamReturningOperators:s,promiseReturningOperators:o}=vm(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:a}}=Pt(),l=mf(),{setDefaultHighWaterMark:c,getDefaultHighWaterMark:d}=co(),{pipeline:f}=ac(),{destroyer:g}=an(),y=sr(),b=gf(),_=Wi(),E=Do.exports=sc().Stream;E.isDestroyed=_.isDestroyed,E.isDisturbed=_.isDisturbed,E.isErrored=_.isErrored,E.isReadable=_.isReadable,E.isWritable=_.isWritable,E.Readable=uo();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=oc(),E.Duplex=Bi(),E.Transform=ff(),E.PassThrough=pf(),E.pipeline=f;const{addAbortSignal:S}=lo();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)},Do.exports}var Wd;function wm(){return Wd||(Wd=1,function(i){const e=yf(),t=gf(),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}(Lo)),Lo.exports}var bf=wm();const na=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 vf(i,e,t=4){let r=!1;for(const n in i)if(n in e){const s=t===0?null:vf(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 wf(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=wf(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 _m{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||Fe}_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&&(xl(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${t}.${r}.${n}.${s}`:`.${t}.${r}.${n}`]}return this._ids[Fr(e)]}_termToNewNumericId(e){const t=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${xl(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:Fr(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 It{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||Fe,this._entityIndex=t.entityIndex||new _m({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 bf.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 Xi(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 Xi&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof It&&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 Xi&&(e=e.filtered),e===this)return!0;if(!(e instanceof It)||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 Xi&&(e=e.filtered),e===this)return new It({entityIndex:this._entityIndex});if(e instanceof It&&e._entityIndex===this._entityIndex){const t=new It({entityIndex:this._entityIndex}),r=wf(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 Xi&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new It({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&t.add(r);return t}intersection(e){if(e instanceof Xi&&(e=e.filtered),e===this){const t=new It({entityIndex:this._entityIndex});return t._graphs=Vn(Object.create(null),this._graphs),t._size=this._size,t}else if(e instanceof It&&this._entityIndex===e._entityIndex){const t=new It({entityIndex:this._entityIndex}),r=vf(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 It({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 nc().quadsToString(this)}union(e){const t=new It({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 Si(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:Si(i[s],e,t+1);o!==!1&&(n=n||Object.create(null),n[s]=o)}return n}class Xi extends bf.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 It({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=Si(_.predicates,[l,c,a]))&&(g=Si(_.subjects,[a,l,c]),b=Si(_.objects,[c,a,l])):c?(b=Si(_.objects,[c,a,l]))&&(g=Si(_.subjects,[a,l,c]),y=Si(_.predicates,[l,c,a])):(g=Si(_.subjects,[a,l,c]))&&(y=Si(_.predicates,[l,c,a]),b=Si(_.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[na]&&(this[na]=this[Symbol.iterator]());const t=this[na];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 nc().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 Xi(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#",Gd="http://datashapes.org/dash#",tr="http://www.w3.org/2001/XMLSchema#",lc="http://www.w3.org/1999/02/22-rdf-syntax-ns#",cc="http://www.w3.org/2000/01/rdf-schema#",dc="http://www.w3.org/2004/02/skos/core#",xm="http://www.w3.org/2002/07/owl#",Em="http://www.w3.org/ns/oa#",Sm="http://purl.org/dc/terms/",km="http://xmlns.com/foaf/0.1/",zs=Fe.namedNode("loaded-shapes"),Ii=Fe.namedNode("loaded-data"),Tt=Fe.namedNode(lc+"type"),El=Fe.namedNode(Sm+"conformsTo"),Im=Fe.namedNode(cc+"subClassOf"),uc=Fe.namedNode(xm+"imports"),Rm=Fe.namedNode(dc+"broader"),Tm=Fe.namedNode(dc+"narrower"),Ts=Fe.namedNode(Ae+"NodeShape"),$m=Fe.namedNode(Ae+"IRI"),Hs=Fe.namedNode(Ae+"property"),hc=Fe.namedNode(Ae+"class"),ts=Fe.namedNode(Ae+"targetClass"),Cm=Fe.namedNode(Ae+"nodeKind"),Am=Fe.namedNode(tr+"string");function zn(i,e,t=Ae,r){let n="";const s=Nm(i,e,t,r);return s&&(n=s.value),n}function Nm(i,e,t=Ae,r){let n;const s=t+e;if(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 Lm(i){i.querySelector("input,select,textarea")?.focus()}function Er(i,e){return zn(i,"prefLabel",dc,e)||zn(i,"label",cc,e)||zn(i,"name",km,e)}function _f(i,e,t){const r=[];for(const n of i)r.push({value:n,label:Er(e.getQuads(n,null,null,null),t),children:[]});return r}function Sl(i,e){for(const t in e)i=i.replace(e[t],"");return i}function xf(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(Tt,i,s)));e.parent&&xf(i,e.parent,t,r,n)}function fc(i,e){if(e.shaclIn){const t=e.config.lists[e.shaclIn];return _f(t?.length?t:[],e.config.store,e.config.languages)}else{const t=e.config.store.getSubjects(Tt,i,zs);t.push(...e.config.store.getSubjects(Tt,i,Ii)),xf(i,e,e.config.store,t);const r=new Map,n=new Map;for(const o of t)r.set(o.id,{value:o,label:Er(e.config.store.getQuads(o,null,null,null),e.config.languages),children:[]});for(const o of t)kl(o,r,n,e);for(const[o,a]of n.entries())r.get(a).children.push(r.get(o));const s=[];for(const[o,a]of r.entries())n.has(o)||s.push(a);for(const o of e.config.store.getSubjects(Im,i,null))s.push(...fc(o,e));return s}}function kl(i,e,t,r){for(const n of r.config.store.getObjects(i,Rm,null))t.set(i.id,n.id),e.has(n.id)||e.set(n.id,{value:n,label:Er(r.config.store.getQuads(n,null,null,null),r.config.languages),children:[]}),kl(n,e,t,r);for(const n of r.config.store.getObjects(i,Tm,null))t.set(n.id,i.id),e.has(n.id)||e.set(n.id,{value:n,label:Er(r.config.store.getQuads(n,null,null,null),r.config.languages),children:[]}),kl(n,e,t,r)}function Il(i){let e;try{e=new URL(i)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function Kd(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 Ef(i,e,t){const r=document.createElement("div");r.classList.add("shacl-or-constraint");const n=[];if(e instanceof ir){const s=[];let o=!1;i.length&&(o=t.store.countQuads(i[0],Hs,null,null)>0);for(let c=0;c<i.length;c++)if(o){const d=t.store.getObjects(i[c],Hs,null),f=[];let g="";for(const y of d){const b=new Ks(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 Ks(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:Er(c,t.languages)||Sl(c[0].predicate.value,t.prefixes)+" = "+Sl(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(js(e.template.clone().merge(s[parseInt(a.value)]),void 0,!0))},r.appendChild(o)}return r}function Dm(i,e,t){if(e instanceof ai){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,Tt,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,ts,a,null).length>0)return s}if(o.predicate.equals(hc)){for(const a of r)if(o.object.equals(a))return s}}else if(o.predicate.equals(Cm)&&o.object.equals($m))return s}}return console.error("couldn't resolve sh:or/sh:xone on property for value",e),[]}function Om(i,e,t){for(const r of i){let n=!1;const s=t.store.getObjects(r,Hs,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 Mm={[`${Ae}name`]:(i,e)=>{const t=e;i.name=Kd(i.config.languages,i.name,t)},[`${Ae}description`]:(i,e)=>{const t=e;i.description=Kd(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)},[`${Gd}singleLine`]:(i,e)=>{i.singleLine=e.value==="true"},[`${Gd}readonly`]:(i,e)=>{i.readonly=e.value==="true"},[`${Em}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=Fe.namedNode(lc+"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)},[uc.id]:(i,e)=>{i.owlImports.push(e)},[hc.id]:(i,e)=>{i.class=e;const t=i.config.store.getSubjects(ts,e,null);t.length>0&&(i.node=t[0])},[`${Ae}or`]:(i,e)=>{const t=i.config.lists[e.value];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?.length?i.shaclXone=t:console.error("list for sh:xone not found:",e.value,"existing lists:",i.config.lists)}};class Pm{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){for(const t of e)Mm[t.predicate.id]?.call(this,this,t.object);if(this.label=this.name?.value||Er(e,this.config.languages),!this.label&&!this.shaclAnd&&(this.label=this.path?Sl(this.path,this.config.prefixes):"unknown"),(this.node||this.shaclAnd)&&(this.node&&this.extendedShapes.push(this.node),this.shaclAnd)){const t=this.config.lists[this.shaclAnd];if(t?.length)for(const r of t)this.extendedShapes.push(r)}return this}clone(){const e=Object.assign({},this);return e.extendedShapes=[...this.extendedShapes],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 jm=`form { display:block; --label-width: 8em; --caret-size: 10px; }
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 Md(i){let e=Km[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 sa={exports:{}},oa={exports:{}},aa,Fd;function ut(){if(Fd)return aa;Fd=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 aa={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},aa}var la={exports:{}},ca,jd;function Wf(){return jd||(jd=1,ca={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"{}"}}}),ca}var da,Bd;function Xt(){if(Bd)return da;Bd=1;const{format:i,inspect:e}=Wf(),{AggregateError:t}=ut(),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_",c={};function l(E,x){if(!E)throw new c.ERR_INTERNAL_ASSERTION(x)}function d(E){let x="",k=E.length;const y=E[0]==="-"?1:0;for(;k>=y+4;k-=3)x=`_${E.slice(k-3,k)}${x}`;return`${E.slice(0,k)}${x}`}function u(E,x,k){if(typeof x=="function")return l(x.length<=k.length,`Code: ${E}; The provided arguments length (${k.length}) does not match the required ones (${x.length}).`),x(...k);const y=(x.match(/%[dfijoOs]/g)||[]).length;return l(y===k.length,`Code: ${E}; The provided arguments length (${k.length}) does not match the required ones (${y}).`),k.length===0?x:i(x,...k)}function p(E,x,k){k||(k=Error);class y extends k{constructor(...m){super(u(E,x,m))}toString(){return`${this.name} [${E}]: ${this.message}`}}Object.defineProperties(y.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}}),y.prototype.code=E,y.prototype[n]=!0,c[E]=y}function g(E){const x=a+E.name;return Object.defineProperty(E,"name",{value:x}),E}function v(E,x){if(E&&x&&E!==x){if(Array.isArray(x.errors))return x.errors.push(E),x;const k=new r([x,E],x.message);return k.code=x.code,k}return E||x}class _ extends Error{constructor(x="The operation was aborted",k=void 0){if(k!==void 0&&typeof k!="object")throw new c.ERR_INVALID_ARG_TYPE("options","Object",k);super(x,k),this.code="ABORT_ERR",this.name="AbortError"}}return p("ERR_ASSERTION","%s",Error),p("ERR_INVALID_ARG_TYPE",(E,x,k)=>{l(typeof E=="string","'name' must be a string"),Array.isArray(x)||(x=[x]);let y="The ";E.endsWith(" argument")?y+=`${E} `:y+=`"${E}" ${E.includes(".")?"property":"argument"} `,y+="must be ";const h=[],m=[],T=[];for(const C of x)l(typeof C=="string","All expected entries have to be of type string"),s.includes(C)?h.push(C.toLowerCase()):o.test(C)?m.push(C):(l(C!=="object",'The value "object" should be written as "Object"'),T.push(C));if(m.length>0){const C=h.indexOf("object");C!==-1&&(h.splice(h,C,1),m.push("Object"))}if(h.length>0){switch(h.length){case 1:y+=`of type ${h[0]}`;break;case 2:y+=`one of type ${h[0]} or ${h[1]}`;break;default:{const C=h.pop();y+=`one of type ${h.join(", ")}, or ${C}`}}(m.length>0||T.length>0)&&(y+=" or ")}if(m.length>0){switch(m.length){case 1:y+=`an instance of ${m[0]}`;break;case 2:y+=`an instance of ${m[0]} or ${m[1]}`;break;default:{const C=m.pop();y+=`an instance of ${m.join(", ")}, or ${C}`}}T.length>0&&(y+=" or ")}switch(T.length){case 0:break;case 1:T[0].toLowerCase()!==T[0]&&(y+="an "),y+=`${T[0]}`;break;case 2:y+=`one of ${T[0]} or ${T[1]}`;break;default:{const C=T.pop();y+=`one of ${T.join(", ")}, or ${C}`}}if(k==null)y+=`. Received ${k}`;else if(typeof k=="function"&&k.name)y+=`. Received function ${k.name}`;else if(typeof k=="object"){var N;if((N=k.constructor)!==null&&N!==void 0&&N.name)y+=`. Received an instance of ${k.constructor.name}`;else{const C=e(k,{depth:-1});y+=`. Received ${C}`}}else{let C=e(k,{colors:!1});C.length>25&&(C=`${C.slice(0,25)}...`),y+=`. Received type ${typeof k} (${C})`}return y},TypeError),p("ERR_INVALID_ARG_VALUE",(E,x,k="is invalid")=>{let y=e(x);return y.length>128&&(y=y.slice(0,128)+"..."),`The ${E.includes(".")?"property":"argument"} '${E}' ${k}. Received ${y}`},TypeError),p("ERR_INVALID_RETURN_VALUE",(E,x,k)=>{var y;const h=k!=null&&(y=k.constructor)!==null&&y!==void 0&&y.name?`instance of ${k.constructor.name}`:`type ${typeof k}`;return`Expected ${E} to be returned from the "${x}" function but got ${h}.`},TypeError),p("ERR_MISSING_ARGS",(...E)=>{l(E.length>0,"At least one arg needs to be specified");let x;const k=E.length;switch(E=(Array.isArray(E)?E:[E]).map(y=>`"${y}"`).join(" or "),k){case 1:x+=`The ${E[0]} argument`;break;case 2:x+=`The ${E[0]} and ${E[1]} arguments`;break;default:{const y=E.pop();x+=`The ${E.join(", ")}, and ${y} arguments`}break}return`${x} must be specified`},TypeError),p("ERR_OUT_OF_RANGE",(E,x,k)=>{l(x,'Missing "range" argument');let y;if(Number.isInteger(k)&&Math.abs(k)>2**32)y=d(String(k));else if(typeof k=="bigint"){y=String(k);const h=BigInt(2)**BigInt(32);(k>h||k<-h)&&(y=d(y)),y+="n"}else y=e(k);return`The value of "${E}" is out of range. It must be ${x}. Received ${y}`},RangeError),p("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),p("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),p("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),p("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),p("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),p("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),p("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),p("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),p("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),p("ERR_STREAM_WRITE_AFTER_END","write after end",Error),p("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),da={AbortError:_,aggregateTwoErrors:g(v),hideStackFrames:g,codes:c},da}var Wn={exports:{}},qd;function Rs(){if(qd)return Wn.exports;qd=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 eo={exports:{}},Ud;function jo(){if(Ud)return eo.exports;Ud=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(h){console&&console.warn&&console.warn(h)}var n=Number.isNaN||function(m){return m!==m};function s(){s.init.call(this)}eo.exports=s,eo.exports.once=x,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(h){if(typeof h!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof h)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(h){if(typeof h!="number"||h<0||n(h))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+h+".");o=h}}),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 c(h){return h._maxListeners===void 0?s.defaultMaxListeners:h._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(m){for(var T=[],N=1;N<arguments.length;N++)T.push(arguments[N]);var C=m==="error",F=this._events;if(F!==void 0)C=C&&F.error===void 0;else if(!C)return!1;if(C){var I;if(T.length>0&&(I=T[0]),I instanceof Error)throw I;var O=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw O.context=I,O}var U=F[m];if(U===void 0)return!1;if(typeof U=="function")e(U,this,T);else for(var R=U.length,D=v(U,R),N=0;N<R;++N)e(D[N],this,T);return!0};function l(h,m,T,N){var C,F,I;if(a(T),F=h._events,F===void 0?(F=h._events=Object.create(null),h._eventsCount=0):(F.newListener!==void 0&&(h.emit("newListener",m,T.listener?T.listener:T),F=h._events),I=F[m]),I===void 0)I=F[m]=T,++h._eventsCount;else if(typeof I=="function"?I=F[m]=N?[T,I]:[I,T]:N?I.unshift(T):I.push(T),C=c(h),C>0&&I.length>C&&!I.warned){I.warned=!0;var O=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(m)+" listeners added. Use emitter.setMaxListeners() to increase limit");O.name="MaxListenersExceededWarning",O.emitter=h,O.type=m,O.count=I.length,r(O)}return h}s.prototype.addListener=function(m,T){return l(this,m,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(m,T){return l(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 u(h,m,T){var N={fired:!1,wrapFn:void 0,target:h,type:m,listener:T},C=d.bind(N);return C.listener=T,N.wrapFn=C,C}s.prototype.once=function(m,T){return a(T),this.on(m,u(this,m,T)),this},s.prototype.prependOnceListener=function(m,T){return a(T),this.prependListener(m,u(this,m,T)),this},s.prototype.removeListener=function(m,T){var N,C,F,I,O;if(a(T),C=this._events,C===void 0)return this;if(N=C[m],N===void 0)return this;if(N===T||N.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete C[m],C.removeListener&&this.emit("removeListener",m,N.listener||T));else if(typeof N!="function"){for(F=-1,I=N.length-1;I>=0;I--)if(N[I]===T||N[I].listener===T){O=N[I].listener,F=I;break}if(F<0)return this;F===0?N.shift():_(N,F),N.length===1&&(C[m]=N[0]),C.removeListener!==void 0&&this.emit("removeListener",m,O||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(m){var T,N,C;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 F=Object.keys(N),I;for(C=0;C<F.length;++C)I=F[C],I!=="removeListener"&&this.removeAllListeners(I);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(C=T.length-1;C>=0;C--)this.removeListener(m,T[C]);return this};function p(h,m,T){var N=h._events;if(N===void 0)return[];var C=N[m];return C===void 0?[]:typeof C=="function"?T?[C.listener||C]:[C]:T?E(C):v(C,C.length)}s.prototype.listeners=function(m){return p(this,m,!0)},s.prototype.rawListeners=function(m){return p(this,m,!1)},s.listenerCount=function(h,m){return typeof h.listenerCount=="function"?h.listenerCount(m):g.call(h,m)},s.prototype.listenerCount=g;function g(h){var m=this._events;if(m!==void 0){var T=m[h];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 v(h,m){for(var T=new Array(m),N=0;N<m;++N)T[N]=h[N];return T}function _(h,m){for(;m+1<h.length;m++)h[m]=h[m+1];h.pop()}function E(h){for(var m=new Array(h.length),T=0;T<m.length;++T)m[T]=h[T].listener||h[T];return m}function x(h,m){return new Promise(function(T,N){function C(I){h.removeListener(m,F),N(I)}function F(){typeof h.removeListener=="function"&&h.removeListener("error",C),T([].slice.call(arguments))}y(h,m,F,{once:!0}),m!=="error"&&k(h,C,{once:!0})})}function k(h,m,T){typeof h.on=="function"&&y(h,"error",m,T)}function y(h,m,T,N){if(typeof h.on=="function")N.once?h.once(m,T):h.on(m,T);else if(typeof h.addEventListener=="function")h.addEventListener(m,function C(F){N.once&&h.removeEventListener(m,C),T(F)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}return eo.exports}var Vd;function ei(){return Vd||(Vd=1,function(i){const e=sr(),{format:t,inspect:r}=Wf(),{codes:{ERR_INVALID_ARG_TYPE:n}}=Xt(),{kResistStopPropagation:s,AggregateError:o,SymbolDispose:a}=ut(),c=globalThis.AbortSignal||Rs().AbortSignal,l=globalThis.AbortController||Rs().AbortController,d=Object.getPrototypeOf(async function(){}).constructor,u=globalThis.Blob||e.Blob,p=typeof u<"u"?function(E){return E instanceof u}:function(E){return!1},g=(_,E)=>{if(_!==void 0&&(_===null||typeof _!="object"||!("aborted"in _)))throw new n(E,"AbortSignal",_)},v=(_,E)=>{if(typeof _!="function")throw new n(E,"Function",_)};i.exports={AggregateError:o,kEmptyObject:Object.freeze({}),once(_){let E=!1;return function(...x){E||(E=!0,_.apply(this,x))}},createDeferredPromise:function(){let _,E;return{promise:new Promise((k,y)=>{_=k,E=y}),resolve:_,reject:E}},promisify(_){return new Promise((E,x)=>{_((k,...y)=>k?x(k):E(...y))})},debuglog(){return function(){}},format:t,inspect:r,types:{isAsyncFunction(_){return _ instanceof d},isArrayBufferView(_){return ArrayBuffer.isView(_)}},isBlob:p,deprecate(_,E){return _},addAbortListener:jo().addAbortListener||function(E,x){if(E===void 0)throw new n("signal","AbortSignal",E);g(E,"signal"),v(x,"listener");let k;return E.aborted?queueMicrotask(()=>x()):(E.addEventListener("abort",x,{__proto__:null,once:!0,[s]:!0}),k=()=>{E.removeEventListener("abort",x)}),{__proto__:null,[a](){var y;(y=k)===null||y===void 0||y()}}},AbortSignalAny:c.any||function(E){if(E.length===1)return E[0];const x=new l,k=()=>x.abort();return E.forEach(y=>{g(y,"signals"),y.addEventListener("abort",k,{once:!0})}),x.signal.addEventListener("abort",()=>{E.forEach(y=>y.removeEventListener("abort",k))},{once:!0}),x.signal}},i.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}(la)),la.exports}var to={},ua,zd;function Fs(){if(zd)return ua;zd=1;const{ArrayIsArray:i,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:r,NumberIsInteger:n,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:a,NumberParseInt:c,ObjectPrototypeHasOwnProperty:l,RegExpPrototypeExec:d,String:u,StringPrototypeToUpperCase:p,StringPrototypeTrim:g}=ut(),{hideStackFrames:v,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:E,ERR_INVALID_ARG_VALUE:x,ERR_OUT_OF_RANGE:k,ERR_UNKNOWN_SIGNAL:y}}=Xt(),{normalizeEncoding:h}=ei(),{isAsyncFunction:m,isArrayBufferView:T}=ei().types,N={};function C(ie){return ie===(ie|0)}function F(ie){return ie===ie>>>0}const I=/^[0-7]+$/,O="must be a 32-bit unsigned integer or an octal string";function U(ie,me,Ee){if(typeof ie>"u"&&(ie=Ee),typeof ie=="string"){if(d(I,ie)===null)throw new x(me,ie,O);ie=c(ie,8)}return Q(ie,me),ie}const R=v((ie,me,Ee=a,fe=o)=>{if(typeof ie!="number")throw new E(me,"number",ie);if(!n(ie))throw new k(me,"an integer",ie);if(ie<Ee||ie>fe)throw new k(me,`>= ${Ee} && <= ${fe}`,ie)}),D=v((ie,me,Ee=-2147483648,fe=2147483647)=>{if(typeof ie!="number")throw new E(me,"number",ie);if(!n(ie))throw new k(me,"an integer",ie);if(ie<Ee||ie>fe)throw new k(me,`>= ${Ee} && <= ${fe}`,ie)}),Q=v((ie,me,Ee=!1)=>{if(typeof ie!="number")throw new E(me,"number",ie);if(!n(ie))throw new k(me,"an integer",ie);const fe=Ee?1:0,Ve=4294967295;if(ie<fe||ie>Ve)throw new k(me,`>= ${fe} && <= ${Ve}`,ie)});function $(ie,me){if(typeof ie!="string")throw new E(me,"string",ie)}function Y(ie,me,Ee=void 0,fe){if(typeof ie!="number")throw new E(me,"number",ie);if(Ee!=null&&ie<Ee||fe!=null&&ie>fe||(Ee!=null||fe!=null)&&s(ie))throw new k(me,`${Ee!=null?`>= ${Ee}`:""}${Ee!=null&&fe!=null?" && ":""}${fe!=null?`<= ${fe}`:""}`,ie)}const B=v((ie,me,Ee)=>{if(!e(Ee,ie)){const Ve="must be one of: "+t(r(Ee,kt=>typeof kt=="string"?`'${kt}'`:u(kt)),", ");throw new x(me,ie,Ve)}});function re(ie,me){if(typeof ie!="boolean")throw new E(me,"boolean",ie)}function S(ie,me,Ee){return ie==null||!l(ie,me)?Ee:ie[me]}const H=v((ie,me,Ee=null)=>{const fe=S(Ee,"allowArray",!1),Ve=S(Ee,"allowFunction",!1);if(!S(Ee,"nullable",!1)&&ie===null||!fe&&i(ie)||typeof ie!="object"&&(!Ve||typeof ie!="function"))throw new E(me,"Object",ie)}),ee=v((ie,me)=>{if(ie!=null&&typeof ie!="object"&&typeof ie!="function")throw new E(me,"a dictionary",ie)}),J=v((ie,me,Ee=0)=>{if(!i(ie))throw new E(me,"Array",ie);if(ie.length<Ee){const fe=`must be longer than ${Ee}`;throw new x(me,ie,fe)}});function he(ie,me){J(ie,me);for(let Ee=0;Ee<ie.length;Ee++)$(ie[Ee],`${me}[${Ee}]`)}function W(ie,me){J(ie,me);for(let Ee=0;Ee<ie.length;Ee++)re(ie[Ee],`${me}[${Ee}]`)}function G(ie,me){J(ie,me);for(let Ee=0;Ee<ie.length;Ee++){const fe=ie[Ee],Ve=`${me}[${Ee}]`;if(fe==null)throw new E(Ve,"AbortSignal",fe);ye(fe,Ve)}}function X(ie,me="signal"){if($(ie,me),N[ie]===void 0)throw N[p(ie)]!==void 0?new y(ie+" (signals must use all capital letters)"):new y(ie)}const z=v((ie,me="buffer")=>{if(!T(ie))throw new E(me,["Buffer","TypedArray","DataView"],ie)});function ne(ie,me){const Ee=h(me),fe=ie.length;if(Ee==="hex"&&fe%2!==0)throw new x("encoding",me,`is invalid for data of length ${fe}`)}function se(ie,me="Port",Ee=!0){if(typeof ie!="number"&&typeof ie!="string"||typeof ie=="string"&&g(ie).length===0||+ie!==+ie>>>0||ie>65535||ie===0&&!Ee)throw new _(me,ie,Ee);return ie|0}const ye=v((ie,me)=>{if(ie!==void 0&&(ie===null||typeof ie!="object"||!("aborted"in ie)))throw new E(me,"AbortSignal",ie)}),_e=v((ie,me)=>{if(typeof ie!="function")throw new E(me,"Function",ie)}),M=v((ie,me)=>{if(typeof ie!="function"||m(ie))throw new E(me,"Function",ie)}),K=v((ie,me)=>{if(ie!==void 0)throw new E(me,"undefined",ie)});function ce(ie,me,Ee){if(!e(Ee,ie))throw new E(me,`('${t(Ee,"|")}')`,ie)}const be=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ve(ie,me){if(typeof ie>"u"||!d(be,ie))throw new x(me,ie,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function xe(ie){if(typeof ie=="string")return ve(ie,"hints"),ie;if(i(ie)){const me=ie.length;let Ee="";if(me===0)return Ee;for(let fe=0;fe<me;fe++){const Ve=ie[fe];ve(Ve,"hints"),Ee+=Ve,fe!==me-1&&(Ee+=", ")}return Ee}throw new x("hints",ie,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return ua={isInt32:C,isUint32:F,parseFileMode:U,validateArray:J,validateStringArray:he,validateBooleanArray:W,validateAbortSignalArray:G,validateBoolean:re,validateBuffer:z,validateDictionary:ee,validateEncoding:ne,validateFunction:_e,validateInt32:D,validateInteger:R,validateNumber:Y,validateObject:H,validateOneOf:B,validatePlainFunction:M,validatePort:se,validateSignalName:X,validateString:$,validateUint32:Q,validateUndefined:K,validateUnion:ce,validateAbortSignal:ye,validateLinkHeaderValue:xe},ua}var io={exports:{}},ha={exports:{}},Hd;function Gr(){if(Hd)return ha.exports;Hd=1;var i=ha.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=[],c=!1,l,d=-1;function u(){!c||!l||(c=!1,l.length?a=l.concat(a):d=-1,a.length&&p())}function p(){if(!c){var _=s(u);c=!0;for(var E=a.length;E;){for(l=a,a=[];++d<E;)l&&l[d].run();d=-1,E=a.length}l=null,c=!1,o(_)}}i.nextTick=function(_){var E=new Array(arguments.length-1);if(arguments.length>1)for(var x=1;x<arguments.length;x++)E[x-1]=arguments[x];a.push(new g(_,E)),a.length===1&&!c&&s(p)};function g(_,E){this.fun=_,this.array=E}g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={};function v(){}return i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,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},ha.exports}var fa,Wd;function or(){if(Wd)return fa;Wd=1;const{SymbolAsyncIterator:i,SymbolIterator:e,SymbolFor:t}=ut(),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"),c=t("nodejs.webstream.isClosedPromise"),l=t("nodejs.webstream.controllerErrorFunction");function d(S,H=!1){var ee;return!!(S&&typeof S.pipe=="function"&&typeof S.on=="function"&&(!H||typeof S.pause=="function"&&typeof S.resume=="function")&&(!S._writableState||((ee=S._readableState)===null||ee===void 0?void 0:ee.readable)!==!1)&&(!S._writableState||S._readableState))}function u(S){var H;return!!(S&&typeof S.write=="function"&&typeof S.on=="function"&&(!S._readableState||((H=S._writableState)===null||H===void 0?void 0:H.writable)!==!1))}function p(S){return!!(S&&typeof S.pipe=="function"&&S._readableState&&typeof S.on=="function"&&typeof S.write=="function")}function g(S){return S&&(S._readableState||S._writableState||typeof S.write=="function"&&typeof S.on=="function"||typeof S.pipe=="function"&&typeof S.on=="function")}function v(S){return!!(S&&!g(S)&&typeof S.pipeThrough=="function"&&typeof S.getReader=="function"&&typeof S.cancel=="function")}function _(S){return!!(S&&!g(S)&&typeof S.getWriter=="function"&&typeof S.abort=="function")}function E(S){return!!(S&&!g(S)&&typeof S.readable=="object"&&typeof S.writable=="object")}function x(S){return v(S)||_(S)||E(S)}function k(S,H){return S==null?!1:H===!0?typeof S[i]=="function":H===!1?typeof S[e]=="function":typeof S[i]=="function"||typeof S[e]=="function"}function y(S){if(!g(S))return null;const H=S._writableState,ee=S._readableState,J=H||ee;return!!(S.destroyed||S[r]||J!=null&&J.destroyed)}function h(S){if(!u(S))return null;if(S.writableEnded===!0)return!0;const H=S._writableState;return H!=null&&H.errored?!1:typeof H?.ended!="boolean"?null:H.ended}function m(S,H){if(!u(S))return null;if(S.writableFinished===!0)return!0;const ee=S._writableState;return ee!=null&&ee.errored?!1:typeof ee?.finished!="boolean"?null:!!(ee.finished||H===!1&&ee.ended===!0&&ee.length===0)}function T(S){if(!d(S))return null;if(S.readableEnded===!0)return!0;const H=S._readableState;return!H||H.errored?!1:typeof H?.ended!="boolean"?null:H.ended}function N(S,H){if(!d(S))return null;const ee=S._readableState;return ee!=null&&ee.errored?!1:typeof ee?.endEmitted!="boolean"?null:!!(ee.endEmitted||H===!1&&ee.ended===!0&&ee.length===0)}function C(S){return S&&S[s]!=null?S[s]:typeof S?.readable!="boolean"?null:y(S)?!1:d(S)&&S.readable&&!N(S)}function F(S){return S&&S[o]!=null?S[o]:typeof S?.writable!="boolean"?null:y(S)?!1:u(S)&&S.writable&&!h(S)}function I(S,H){return g(S)?y(S)?!0:!(H?.readable!==!1&&C(S)||H?.writable!==!1&&F(S)):null}function O(S){var H,ee;return g(S)?S.writableErrored?S.writableErrored:(H=(ee=S._writableState)===null||ee===void 0?void 0:ee.errored)!==null&&H!==void 0?H:null:null}function U(S){var H,ee;return g(S)?S.readableErrored?S.readableErrored:(H=(ee=S._readableState)===null||ee===void 0?void 0:ee.errored)!==null&&H!==void 0?H:null:null}function R(S){if(!g(S))return null;if(typeof S.closed=="boolean")return S.closed;const H=S._writableState,ee=S._readableState;return typeof H?.closed=="boolean"||typeof ee?.closed=="boolean"?H?.closed||ee?.closed:typeof S._closed=="boolean"&&D(S)?S._closed:null}function D(S){return typeof S._closed=="boolean"&&typeof S._defaultKeepAlive=="boolean"&&typeof S._removedConnection=="boolean"&&typeof S._removedContLen=="boolean"}function Q(S){return typeof S._sent100=="boolean"&&D(S)}function $(S){var H;return typeof S._consuming=="boolean"&&typeof S._dumped=="boolean"&&((H=S.req)===null||H===void 0?void 0:H.upgradeOrConnect)===void 0}function Y(S){if(!g(S))return null;const H=S._writableState,ee=S._readableState,J=H||ee;return!J&&Q(S)||!!(J&&J.autoDestroy&&J.emitClose&&J.closed===!1)}function B(S){var H;return!!(S&&((H=S[a])!==null&&H!==void 0?H:S.readableDidRead||S.readableAborted))}function re(S){var H,ee,J,he,W,G,X,z,ne,se;return!!(S&&((H=(ee=(J=(he=(W=(G=S[n])!==null&&G!==void 0?G:S.readableErrored)!==null&&W!==void 0?W:S.writableErrored)!==null&&he!==void 0?he:(X=S._readableState)===null||X===void 0?void 0:X.errorEmitted)!==null&&J!==void 0?J:(z=S._writableState)===null||z===void 0?void 0:z.errorEmitted)!==null&&ee!==void 0?ee:(ne=S._readableState)===null||ne===void 0?void 0:ne.errored)!==null&&H!==void 0?H:!((se=S._writableState)===null||se===void 0)&&se.errored))}return fa={isDestroyed:y,kIsDestroyed:r,isDisturbed:B,kIsDisturbed:a,isErrored:re,kIsErrored:n,isReadable:C,kIsReadable:s,kIsClosedPromise:c,kControllerErrorFunction:l,kIsWritable:o,isClosed:R,isDuplexNodeStream:p,isFinished:I,isIterable:k,isReadableNodeStream:d,isReadableStream:v,isReadableEnded:T,isReadableFinished:N,isReadableErrored:U,isNodeStream:g,isWebStream:x,isWritable:F,isWritableNodeStream:u,isWritableStream:_,isWritableEnded:h,isWritableFinished:m,isWritableErrored:O,isServerRequest:$,isServerResponse:Q,willEmitClose:Y,isTransformStream:E},fa}var Gd;function _r(){if(Gd)return io.exports;Gd=1;const i=Gr(),{AbortError:e,codes:t}=Xt(),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:n}=t,{kEmptyObject:s,once:o}=ei(),{validateAbortSignal:a,validateFunction:c,validateObject:l,validateBoolean:d}=Fs(),{Promise:u,PromisePrototypeThen:p,SymbolDispose:g}=ut(),{isClosed:v,isReadable:_,isReadableNodeStream:E,isReadableStream:x,isReadableFinished:k,isReadableErrored:y,isWritable:h,isWritableNodeStream:m,isWritableStream:T,isWritableFinished:N,isWritableErrored:C,isNodeStream:F,willEmitClose:I,kIsClosedPromise:O}=or();let U;function R(B){return B.setHeader&&typeof B.abort=="function"}const D=()=>{};function Q(B,re,S){var H,ee;if(arguments.length===2?(S=re,re=s):re==null?re=s:l(re,"options"),c(S,"callback"),a(re.signal,"options.signal"),S=o(S),x(B)||T(B))return $(B,re,S);if(!F(B))throw new r("stream",["ReadableStream","WritableStream","Stream"],B);const J=(H=re.readable)!==null&&H!==void 0?H:E(B),he=(ee=re.writable)!==null&&ee!==void 0?ee:m(B),W=B._writableState,G=B._readableState,X=()=>{B.writable||se()};let z=I(B)&&E(B)===J&&m(B)===he,ne=N(B,!1);const se=()=>{ne=!0,B.destroyed&&(z=!1),!(z&&(!B.readable||J))&&(!J||ye)&&S.call(B)};let ye=k(B,!1);const _e=()=>{ye=!0,B.destroyed&&(z=!1),!(z&&(!B.writable||he))&&(!he||ne)&&S.call(B)},M=ie=>{S.call(B,ie)};let K=v(B);const ce=()=>{K=!0;const ie=C(B)||y(B);if(ie&&typeof ie!="boolean")return S.call(B,ie);if(J&&!ye&&E(B,!0)&&!k(B,!1))return S.call(B,new n);if(he&&!ne&&!N(B,!1))return S.call(B,new n);S.call(B)},be=()=>{K=!0;const ie=C(B)||y(B);if(ie&&typeof ie!="boolean")return S.call(B,ie);S.call(B)},ve=()=>{B.req.on("finish",se)};R(B)?(B.on("complete",se),z||B.on("abort",ce),B.req?ve():B.on("request",ve)):he&&!W&&(B.on("end",X),B.on("close",X)),!z&&typeof B.aborted=="boolean"&&B.on("aborted",ce),B.on("end",_e),B.on("finish",se),re.error!==!1&&B.on("error",M),B.on("close",ce),K?i.nextTick(ce):W!=null&&W.errorEmitted||G!=null&&G.errorEmitted?z||i.nextTick(be):(!J&&(!z||_(B))&&(ne||h(B)===!1)||!he&&(!z||h(B))&&(ye||_(B)===!1)||G&&B.req&&B.aborted)&&i.nextTick(be);const xe=()=>{S=D,B.removeListener("aborted",ce),B.removeListener("complete",se),B.removeListener("abort",ce),B.removeListener("request",ve),B.req&&B.req.removeListener("finish",se),B.removeListener("end",X),B.removeListener("close",X),B.removeListener("finish",se),B.removeListener("end",_e),B.removeListener("error",M),B.removeListener("close",ce)};if(re.signal&&!K){const ie=()=>{const me=S;xe(),me.call(B,new e(void 0,{cause:re.signal.reason}))};if(re.signal.aborted)i.nextTick(ie);else{U=U||ei().addAbortListener;const me=U(re.signal,ie),Ee=S;S=o((...fe)=>{me[g](),Ee.apply(B,fe)})}}return xe}function $(B,re,S){let H=!1,ee=D;if(re.signal)if(ee=()=>{H=!0,S.call(B,new e(void 0,{cause:re.signal.reason}))},re.signal.aborted)i.nextTick(ee);else{U=U||ei().addAbortListener;const he=U(re.signal,ee),W=S;S=o((...G)=>{he[g](),W.apply(B,G)})}const J=(...he)=>{H||i.nextTick(()=>S.apply(B,he))};return p(B[O].promise,J,J),D}function Y(B,re){var S;let H=!1;return re===null&&(re=s),(S=re)!==null&&S!==void 0&&S.cleanup&&(d(re.cleanup,"cleanup"),H=re.cleanup),new u((ee,J)=>{const he=Q(B,re,W=>{H&&he(),W?J(W):ee()})})}return io.exports=Q,io.exports.finished=Y,io.exports}var pa,Kd;function $n(){if(Kd)return pa;Kd=1;const i=Gr(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:r}=Xt(),{Symbol:n}=ut(),{kIsDestroyed:s,isDestroyed:o,isFinished:a,isServerRequest:c}=or(),l=n("kDestroy"),d=n("kConstruct");function u(I,O,U){I&&(I.stack,O&&!O.errored&&(O.errored=I),U&&!U.errored&&(U.errored=I))}function p(I,O){const U=this._readableState,R=this._writableState,D=R||U;return R!=null&&R.destroyed||U!=null&&U.destroyed?(typeof O=="function"&&O(),this):(u(I,R,U),R&&(R.destroyed=!0),U&&(U.destroyed=!0),D.constructed?g(this,I,O):this.once(l,function(Q){g(this,e(Q,I),O)}),this)}function g(I,O,U){let R=!1;function D(Q){if(R)return;R=!0;const $=I._readableState,Y=I._writableState;u(Q,Y,$),Y&&(Y.closed=!0),$&&($.closed=!0),typeof U=="function"&&U(Q),Q?i.nextTick(v,I,Q):i.nextTick(_,I)}try{I._destroy(O||null,D)}catch(Q){D(Q)}}function v(I,O){E(I,O),_(I)}function _(I){const O=I._readableState,U=I._writableState;U&&(U.closeEmitted=!0),O&&(O.closeEmitted=!0),(U!=null&&U.emitClose||O!=null&&O.emitClose)&&I.emit("close")}function E(I,O){const U=I._readableState,R=I._writableState;R!=null&&R.errorEmitted||U!=null&&U.errorEmitted||(R&&(R.errorEmitted=!0),U&&(U.errorEmitted=!0),I.emit("error",O))}function x(){const I=this._readableState,O=this._writableState;I&&(I.constructed=!0,I.closed=!1,I.closeEmitted=!1,I.destroyed=!1,I.errored=null,I.errorEmitted=!1,I.reading=!1,I.ended=I.readable===!1,I.endEmitted=I.readable===!1),O&&(O.constructed=!0,O.destroyed=!1,O.closed=!1,O.closeEmitted=!1,O.errored=null,O.errorEmitted=!1,O.finalCalled=!1,O.prefinished=!1,O.ended=O.writable===!1,O.ending=O.writable===!1,O.finished=O.writable===!1)}function k(I,O,U){const R=I._readableState,D=I._writableState;if(D!=null&&D.destroyed||R!=null&&R.destroyed)return this;R!=null&&R.autoDestroy||D!=null&&D.autoDestroy?I.destroy(O):O&&(O.stack,D&&!D.errored&&(D.errored=O),R&&!R.errored&&(R.errored=O),U?i.nextTick(E,I,O):E(I,O))}function y(I,O){if(typeof I._construct!="function")return;const U=I._readableState,R=I._writableState;U&&(U.constructed=!1),R&&(R.constructed=!1),I.once(d,O),!(I.listenerCount(d)>1)&&i.nextTick(h,I)}function h(I){let O=!1;function U(R){if(O){k(I,R??new t);return}O=!0;const D=I._readableState,Q=I._writableState,$=Q||D;D&&(D.constructed=!0),Q&&(Q.constructed=!0),$.destroyed?I.emit(l,R):R?k(I,R,!0):i.nextTick(m,I)}try{I._construct(R=>{i.nextTick(U,R)})}catch(R){i.nextTick(U,R)}}function m(I){I.emit(d)}function T(I){return I?.setHeader&&typeof I.abort=="function"}function N(I){I.emit("close")}function C(I,O){I.emit("error",O),i.nextTick(N,I)}function F(I,O){!I||o(I)||(!O&&!a(I)&&(O=new r),c(I)?(I.socket=null,I.destroy(O)):T(I)?I.abort():T(I.req)?I.req.abort():typeof I.destroy=="function"?I.destroy(O):typeof I.close=="function"?I.close():O?i.nextTick(C,I,O):i.nextTick(N,I),I.destroyed||(I[s]=!0))}return pa={construct:y,destroyer:F,destroy:p,undestroy:x,errorOrDestroy:k},pa}var ma,Xd;function Dc(){if(Xd)return ma;Xd=1;const{ArrayIsArray:i,ObjectSetPrototypeOf:e}=ut(),{EventEmitter:t}=jo();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 c(_){s.writable&&s.write(_)===!1&&a.pause&&a.pause()}a.on("data",c);function l(){a.readable&&a.resume&&a.resume()}s.on("drain",l),!s._isStdio&&(!o||o.end!==!1)&&(a.on("end",u),a.on("close",p));let d=!1;function u(){d||(d=!0,s.end())}function p(){d||(d=!0,typeof s.destroy=="function"&&s.destroy())}function g(_){v(),t.listenerCount(this,"error")===0&&this.emit("error",_)}n(a,"error",g),n(s,"error",g);function v(){a.removeListener("data",c),s.removeListener("drain",l),a.removeListener("end",u),a.removeListener("close",p),a.removeListener("error",g),s.removeListener("error",g),a.removeListener("end",v),a.removeListener("close",v),s.removeListener("close",v)}return a.on("end",v),a.on("close",v),s.on("close",v),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 ma={Stream:r,prependListener:n},ma}var ga={exports:{}},Jd;function Bo(){return Jd||(Jd=1,function(i){const{SymbolDispose:e}=ut(),{AbortError:t,codes:r}=Xt(),{isNodeStream:n,isWebStream:s,kControllerErrorFunction:o}=or(),a=_r(),{ERR_INVALID_ARG_TYPE:c}=r;let l;const d=(u,p)=>{if(typeof u!="object"||!("aborted"in u))throw new c(p,"AbortSignal",u)};i.exports.addAbortSignal=function(p,g){if(d(p,"signal"),!n(g)&&!s(g))throw new c("stream",["ReadableStream","WritableStream","Stream"],g);return i.exports.addAbortSignalNoValidate(p,g)},i.exports.addAbortSignalNoValidate=function(u,p){if(typeof u!="object"||!("aborted"in u))return p;const g=n(p)?()=>{p.destroy(new t(void 0,{cause:u.reason}))}:()=>{p[o](new t(void 0,{cause:u.reason}))};if(u.aborted)g();else{l=l||ei().addAbortListener;const v=l(u,g);a(p,v[e])}return p}}(ga)),ga.exports}var ba,Qd;function Xm(){if(Qd)return ba;Qd=1;const{StringPrototypeSlice:i,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:r}=ut(),{Buffer:n}=sr(),{inspect:s}=ei();return ba=class{constructor(){this.head=null,this.tail=null,this.length=0}push(a){const c={data:a,next:null};this.length>0?this.tail.next=c:this.head=c,this.tail=c,++this.length}unshift(a){const c={data:a,next:this.head};this.length===0&&(this.tail=c),this.head=c,++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 c=this.head,l=""+c.data;for(;(c=c.next)!==null;)l+=a+c.data;return l}concat(a){if(this.length===0)return n.alloc(0);const c=n.allocUnsafe(a>>>0);let l=this.head,d=0;for(;l;)t(c,l.data,d),d+=l.data.length,l=l.next;return c}consume(a,c){const l=this.head.data;if(a<l.length){const d=l.slice(0,a);return this.head.data=l.slice(a),d}return a===l.length?this.shift():c?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 c="",l=this.head,d=0;do{const u=l.data;if(a>u.length)c+=u,a-=u.length;else{a===u.length?(c+=u,++d,l.next?this.head=l.next:this.head=this.tail=null):(c+=i(u,0,a),this.head=l,l.data=i(u,a));break}++d}while((l=l.next)!==null);return this.length-=d,c}_getBuffer(a){const c=n.allocUnsafe(a),l=a;let d=this.head,u=0;do{const p=d.data;if(a>p.length)t(c,p,l-a),a-=p.length;else{a===p.length?(t(c,p,l-a),++u,d.next?this.head=d.next:this.head=this.tail=null):(t(c,new r(p.buffer,p.byteOffset,a),l-a),this.head=d,d.data=p.slice(a));break}++u}while((d=d.next)!==null);return this.length-=u,c}[Symbol.for("nodejs.util.inspect.custom")](a,c){return s(this,{...c,depth:0,customInspect:!1})}},ba}var ya,Yd;function qo(){if(Yd)return ya;Yd=1;const{MathFloor:i,NumberIsInteger:e}=ut(),{validateInteger:t}=Fs(),{ERR_INVALID_ARG_VALUE:r}=Xt().codes;let n=16*1024,s=16;function o(d,u,p){return d.highWaterMark!=null?d.highWaterMark:u?d[p]:null}function a(d){return d?s:n}function c(d,u){t(u,"value",0),d?s=u:n=u}function l(d,u,p,g){const v=o(u,g,p);if(v!=null){if(!e(v)||v<0){const _=g?`options.${p}`:"options.highWaterMark";throw new r(_,v)}return i(v)}return a(d.objectMode)}return ya={getHighWaterMark:l,getDefaultHighWaterMark:a,setDefaultHighWaterMark:c},ya}var va={},ro={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Zd;function Jm(){return Zd||(Zd=1,function(i,e){var t=sr(),r=t.Buffer;function n(o,a){for(var c in o)a[c]=o[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?i.exports=t:(n(t,e),e.Buffer=s);function s(o,a,c){return r(o,a,c)}s.prototype=Object.create(r.prototype),n(r,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=r(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},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)}}(ro,ro.exports)),ro.exports}var eu;function Qm(){if(eu)return va;eu=1;var i=Jm().Buffer,e=i.isEncoding||function(x){switch(x=""+x,x&&x.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(x){if(!x)return"utf8";for(var k;;)switch(x){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 x;default:if(k)return;x=(""+x).toLowerCase(),k=!0}}function r(x){var k=t(x);if(typeof k!="string"&&(i.isEncoding===e||!e(x)))throw new Error("Unknown encoding: "+x);return k||x}va.StringDecoder=n;function n(x){this.encoding=r(x);var k;switch(this.encoding){case"utf16le":this.text=u,this.end=p,k=4;break;case"utf8":this.fillLast=c,k=4;break;case"base64":this.text=g,this.end=v,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(x){if(x.length===0)return"";var k,y;if(this.lastNeed){if(k=this.fillLast(x),k===void 0)return"";y=this.lastNeed,this.lastNeed=0}else y=0;return y<x.length?k?k+this.text(x,y):this.text(x,y):k||""},n.prototype.end=d,n.prototype.text=l,n.prototype.fillLast=function(x){if(this.lastNeed<=x.length)return x.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);x.copy(this.lastChar,this.lastTotal-this.lastNeed,0,x.length),this.lastNeed-=x.length};function s(x){return x<=127?0:x>>5===6?2:x>>4===14?3:x>>3===30?4:x>>6===2?-1:-2}function o(x,k,y){var h=k.length-1;if(h<y)return 0;var m=s(k[h]);return m>=0?(m>0&&(x.lastNeed=m-1),m):--h<y||m===-2?0:(m=s(k[h]),m>=0?(m>0&&(x.lastNeed=m-2),m):--h<y||m===-2?0:(m=s(k[h]),m>=0?(m>0&&(m===2?m=0:x.lastNeed=m-3),m):0))}function a(x,k,y){if((k[0]&192)!==128)return x.lastNeed=0,"�";if(x.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return x.lastNeed=1,"�";if(x.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return x.lastNeed=2,"�"}}function c(x){var k=this.lastTotal-this.lastNeed,y=a(this,x);if(y!==void 0)return y;if(this.lastNeed<=x.length)return x.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);x.copy(this.lastChar,k,0,x.length),this.lastNeed-=x.length}function l(x,k){var y=o(this,x,k);if(!this.lastNeed)return x.toString("utf8",k);this.lastTotal=y;var h=x.length-(y-this.lastNeed);return x.copy(this.lastChar,0,h),x.toString("utf8",k,h)}function d(x){var k=x&&x.length?this.write(x):"";return this.lastNeed?k+"�":k}function u(x,k){if((x.length-k)%2===0){var y=x.toString("utf16le",k);if(y){var h=y.charCodeAt(y.length-1);if(h>=55296&&h<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=x[x.length-2],this.lastChar[1]=x[x.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=x[x.length-1],x.toString("utf16le",k,x.length-1)}function p(x){var k=x&&x.length?this.write(x):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,y)}return k}function g(x,k){var y=(x.length-k)%3;return y===0?x.toString("base64",k):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=x[x.length-1]:(this.lastChar[0]=x[x.length-2],this.lastChar[1]=x[x.length-1]),x.toString("base64",k,x.length-y))}function v(x){var k=x&&x.length?this.write(x):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function _(x){return x.toString(this.encoding)}function E(x){return x&&x.length?this.write(x):""}return va}var wa,tu;function Gf(){if(tu)return wa;tu=1;const i=Gr(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:r}=ut(),{Buffer:n}=sr(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:o}=Xt().codes;function a(c,l,d){let u;if(typeof l=="string"||l instanceof n)return new c({objectMode:!0,...d,read(){this.push(l),this.push(null)}});let p;if(l&&l[t])p=!0,u=l[t]();else if(l&&l[r])p=!1,u=l[r]();else throw new s("iterable",["Iterable"],l);const g=new c({objectMode:!0,highWaterMark:1,...d});let v=!1;g._read=function(){v||(v=!0,E())},g._destroy=function(x,k){e(_(x),()=>i.nextTick(k,x),y=>i.nextTick(k,y||x))};async function _(x){const k=x!=null,y=typeof u.throw=="function";if(k&&y){const{value:h,done:m}=await u.throw(x);if(await h,m)return}if(typeof u.return=="function"){const{value:h}=await u.return();await h}}async function E(){for(;;){try{const{value:x,done:k}=p?await u.next():u.next();if(k)g.push(null);else{const y=x&&typeof x.then=="function"?await x:x;if(y===null)throw v=!1,new o;if(g.push(y))continue;v=!1}}catch(x){g.destroy(x)}break}}return g}return wa=a,wa}var _a,iu;function Uo(){if(iu)return _a;iu=1;const i=Gr(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:r,NumberParseInt:n,ObjectDefineProperties:s,ObjectKeys:o,ObjectSetPrototypeOf:a,Promise:c,SafeSet:l,SymbolAsyncDispose:d,SymbolAsyncIterator:u,Symbol:p}=ut();_a=fe,fe.ReadableState=Ee;const{EventEmitter:g}=jo(),{Stream:v,prependListener:_}=Dc(),{Buffer:E}=sr(),{addAbortSignal:x}=Bo(),k=_r();let y=ei().debuglog("stream",P=>{y=P});const h=Xm(),m=$n(),{getHighWaterMark:T,getDefaultHighWaterMark:N}=qo(),{aggregateTwoErrors:C,codes:{ERR_INVALID_ARG_TYPE:F,ERR_METHOD_NOT_IMPLEMENTED:I,ERR_OUT_OF_RANGE:O,ERR_STREAM_PUSH_AFTER_EOF:U,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:R},AbortError:D}=Xt(),{validateObject:Q}=Fs(),$=p("kPaused"),{StringDecoder:Y}=Qm(),B=Gf();a(fe.prototype,v.prototype),a(fe,v);const re=()=>{},{errorOrDestroy:S}=m,H=1,ee=2,J=4,he=8,W=16,G=32,X=64,z=128,ne=256,se=512,ye=1024,_e=2048,M=4096,K=8192,ce=16384,be=32768,ve=65536,xe=1<<17,ie=1<<18;function me(P){return{enumerable:!1,get(){return(this.state&P)!==0},set(V){V?this.state|=P:this.state&=~P}}}s(Ee.prototype,{objectMode:me(H),ended:me(ee),endEmitted:me(J),reading:me(he),constructed:me(W),sync:me(G),needReadable:me(X),emittedReadable:me(z),readableListening:me(ne),resumeScheduled:me(se),errorEmitted:me(ye),emitClose:me(_e),autoDestroy:me(M),destroyed:me(K),closed:me(ce),closeEmitted:me(be),multiAwaitDrain:me(ve),readingMore:me(xe),dataEmitted:me(ie)});function Ee(P,V,Se){typeof Se!="boolean"&&(Se=V instanceof Zi()),this.state=_e|M|W|G,P&&P.objectMode&&(this.state|=H),Se&&P&&P.readableObjectMode&&(this.state|=H),this.highWaterMark=P?T(this,P,"readableHighWaterMark",Se):N(!1),this.buffer=new h,this.length=0,this.pipes=[],this.flowing=null,this[$]=null,P&&P.emitClose===!1&&(this.state&=~_e),P&&P.autoDestroy===!1&&(this.state&=~M),this.errored=null,this.defaultEncoding=P&&P.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,P&&P.encoding&&(this.decoder=new Y(P.encoding),this.encoding=P.encoding)}function fe(P){if(!(this instanceof fe))return new fe(P);const V=this instanceof Zi();this._readableState=new Ee(P,this,V),P&&(typeof P.read=="function"&&(this._read=P.read),typeof P.destroy=="function"&&(this._destroy=P.destroy),typeof P.construct=="function"&&(this._construct=P.construct),P.signal&&!V&&x(P.signal,this)),v.call(this,P),m.construct(this,()=>{this._readableState.needReadable&&te(this,this._readableState)})}fe.prototype.destroy=m.destroy,fe.prototype._undestroy=m.undestroy,fe.prototype._destroy=function(P,V){V(P)},fe.prototype[g.captureRejectionSymbol]=function(P){this.destroy(P)},fe.prototype[d]=function(){let P;return this.destroyed||(P=this.readableEnded?null:new D,this.destroy(P)),new c((V,Se)=>k(this,ke=>ke&&ke!==P?Se(ke):V(null)))},fe.prototype.push=function(P,V){return Ve(this,P,V,!1)},fe.prototype.unshift=function(P,V){return Ve(this,P,V,!0)};function Ve(P,V,Se,ke){y("readableAddChunk",V);const Ce=P._readableState;let Rt;if((Ce.state&H)===0&&(typeof V=="string"?(Se=Se||Ce.defaultEncoding,Ce.encoding!==Se&&(ke&&Ce.encoding?V=E.from(V,Se).toString(Ce.encoding):(V=E.from(V,Se),Se=""))):V instanceof E?Se="":v._isUint8Array(V)?(V=v._uint8ArrayToBuffer(V),Se=""):V!=null&&(Rt=new F("chunk",["string","Buffer","Uint8Array"],V))),Rt)S(P,Rt);else if(V===null)Ce.state&=~he,f(P,Ce);else if((Ce.state&H)!==0||V&&V.length>0)if(ke)if((Ce.state&J)!==0)S(P,new R);else{if(Ce.destroyed||Ce.errored)return!1;kt(P,Ce,V,!0)}else if(Ce.ended)S(P,new U);else{if(Ce.destroyed||Ce.errored)return!1;Ce.state&=~he,Ce.decoder&&!Se?(V=Ce.decoder.write(V),Ce.objectMode||V.length!==0?kt(P,Ce,V,!1):te(P,Ce)):kt(P,Ce,V,!1)}else ke||(Ce.state&=~he,te(P,Ce));return!Ce.ended&&(Ce.length<Ce.highWaterMark||Ce.length===0)}function kt(P,V,Se,ke){V.flowing&&V.length===0&&!V.sync&&P.listenerCount("data")>0?((V.state&ve)!==0?V.awaitDrainWriters.clear():V.awaitDrainWriters=null,V.dataEmitted=!0,P.emit("data",Se)):(V.length+=V.objectMode?1:Se.length,ke?V.buffer.unshift(Se):V.buffer.push(Se),(V.state&X)!==0&&b(P)),te(P,V)}fe.prototype.isPaused=function(){const P=this._readableState;return P[$]===!0||P.flowing===!1},fe.prototype.setEncoding=function(P){const V=new Y(P);this._readableState.decoder=V,this._readableState.encoding=this._readableState.decoder.encoding;const Se=this._readableState.buffer;let ke="";for(const Ce of Se)ke+=V.write(Ce);return Se.clear(),ke!==""&&Se.push(ke),this._readableState.length=ke.length,this};const Ue=1073741824;function Nt(P){if(P>Ue)throw new O("size","<= 1GiB",P);return P--,P|=P>>>1,P|=P>>>2,P|=P>>>4,P|=P>>>8,P|=P>>>16,P++,P}function A(P,V){return P<=0||V.length===0&&V.ended?0:(V.state&H)!==0?1:r(P)?V.flowing&&V.length?V.buffer.first().length:V.length:P<=V.length?P:V.ended?V.length:0}fe.prototype.read=function(P){y("read",P),P===void 0?P=NaN:t(P)||(P=n(P,10));const V=this._readableState,Se=P;if(P>V.highWaterMark&&(V.highWaterMark=Nt(P)),P!==0&&(V.state&=~z),P===0&&V.needReadable&&((V.highWaterMark!==0?V.length>=V.highWaterMark:V.length>0)||V.ended))return y("read: emitReadable",V.length,V.ended),V.length===0&&V.ended?mt(this):b(this),null;if(P=A(P,V),P===0&&V.ended)return V.length===0&&mt(this),null;let ke=(V.state&X)!==0;if(y("need readable",ke),(V.length===0||V.length-P<V.highWaterMark)&&(ke=!0,y("length less than watermark",ke)),V.ended||V.reading||V.destroyed||V.errored||!V.constructed)ke=!1,y("reading, ended or constructing",ke);else if(ke){y("do read"),V.state|=he|G,V.length===0&&(V.state|=X);try{this._read(V.highWaterMark)}catch(Rt){S(this,Rt)}V.state&=~G,V.reading||(P=A(Se,V))}let Ce;return P>0?Ce=ft(P,V):Ce=null,Ce===null?(V.needReadable=V.length<=V.highWaterMark,P=0):(V.length-=P,V.multiAwaitDrain?V.awaitDrainWriters.clear():V.awaitDrainWriters=null),V.length===0&&(V.ended||(V.needReadable=!0),Se!==P&&V.ended&&mt(this)),Ce!==null&&!V.errorEmitted&&!V.closeEmitted&&(V.dataEmitted=!0,this.emit("data",Ce)),Ce};function f(P,V){if(y("onEofChunk"),!V.ended){if(V.decoder){const Se=V.decoder.end();Se&&Se.length&&(V.buffer.push(Se),V.length+=V.objectMode?1:Se.length)}V.ended=!0,V.sync?b(P):(V.needReadable=!1,V.emittedReadable=!0,j(P))}}function b(P){const V=P._readableState;y("emitReadable",V.needReadable,V.emittedReadable),V.needReadable=!1,V.emittedReadable||(y("emitReadable",V.flowing),V.emittedReadable=!0,i.nextTick(j,P))}function j(P){const V=P._readableState;y("emitReadable_",V.destroyed,V.length,V.ended),!V.destroyed&&!V.errored&&(V.length||V.ended)&&(P.emit("readable"),V.emittedReadable=!1),V.needReadable=!V.flowing&&!V.ended&&V.length<=V.highWaterMark,Xe(P)}function te(P,V){!V.readingMore&&V.constructed&&(V.readingMore=!0,i.nextTick(ue,P,V))}function ue(P,V){for(;!V.reading&&!V.ended&&(V.length<V.highWaterMark||V.flowing&&V.length===0);){const Se=V.length;if(y("maybeReadMore read 0"),P.read(0),Se===V.length)break}V.readingMore=!1}fe.prototype._read=function(P){throw new I("_read()")},fe.prototype.pipe=function(P,V){const Se=this,ke=this._readableState;ke.pipes.length===1&&(ke.multiAwaitDrain||(ke.multiAwaitDrain=!0,ke.awaitDrainWriters=new l(ke.awaitDrainWriters?[ke.awaitDrainWriters]:[]))),ke.pipes.push(P),y("pipe count=%d opts=%j",ke.pipes.length,V);const Rt=(!V||V.end!==!1)&&P!==i.stdout&&P!==i.stderr?Ks:q;ke.endEmitted?i.nextTick(Rt):Se.once("end",Rt),P.on("unpipe",Mt);function Mt(ae,le){y("onunpipe"),ae===Se&&le&&le.hasUnpiped===!1&&(le.hasUnpiped=!0,Xi())}function Ks(){y("onend"),P.end()}let Ki,Xs=!1;function Xi(){y("cleanup"),P.removeListener("close",jn),P.removeListener("finish",_t),Ki&&P.removeListener("drain",Ki),P.removeListener("error",en),P.removeListener("unpipe",Mt),Se.removeListener("end",Ks),Se.removeListener("end",q),Se.removeListener("data",Zr),Xs=!0,Ki&&ke.awaitDrainWriters&&(!P._writableState||P._writableState.needDrain)&&Ki()}function Fn(){Xs||(ke.pipes.length===1&&ke.pipes[0]===P?(y("false write response, pause",0),ke.awaitDrainWriters=P,ke.multiAwaitDrain=!1):ke.pipes.length>1&&ke.pipes.includes(P)&&(y("false write response, pause",ke.awaitDrainWriters.size),ke.awaitDrainWriters.add(P)),Se.pause()),Ki||(Ki=ge(Se,P),P.on("drain",Ki))}Se.on("data",Zr);function Zr(ae){y("ondata");const le=P.write(ae);y("dest.write",le),le===!1&&Fn()}function en(ae){if(y("onerror",ae),q(),P.removeListener("error",en),P.listenerCount("error")===0){const le=P._writableState||P._readableState;le&&!le.errorEmitted?S(P,ae):P.emit("error",ae)}}_(P,"error",en);function jn(){P.removeListener("finish",_t),q()}P.once("close",jn);function _t(){y("onfinish"),P.removeListener("close",jn),q()}P.once("finish",_t);function q(){y("unpipe"),Se.unpipe(P)}return P.emit("pipe",Se),P.writableNeedDrain===!0?Fn():ke.flowing||(y("pipe resume"),Se.resume()),P};function ge(P,V){return function(){const ke=P._readableState;ke.awaitDrainWriters===V?(y("pipeOnDrain",1),ke.awaitDrainWriters=null):ke.multiAwaitDrain&&(y("pipeOnDrain",ke.awaitDrainWriters.size),ke.awaitDrainWriters.delete(V)),(!ke.awaitDrainWriters||ke.awaitDrainWriters.size===0)&&P.listenerCount("data")&&P.resume()}}fe.prototype.unpipe=function(P){const V=this._readableState,Se={hasUnpiped:!1};if(V.pipes.length===0)return this;if(!P){const Ce=V.pipes;V.pipes=[],this.pause();for(let Rt=0;Rt<Ce.length;Rt++)Ce[Rt].emit("unpipe",this,{hasUnpiped:!1});return this}const ke=e(V.pipes,P);return ke===-1?this:(V.pipes.splice(ke,1),V.pipes.length===0&&this.pause(),P.emit("unpipe",this,Se),this)},fe.prototype.on=function(P,V){const Se=v.prototype.on.call(this,P,V),ke=this._readableState;return P==="data"?(ke.readableListening=this.listenerCount("readable")>0,ke.flowing!==!1&&this.resume()):P==="readable"&&!ke.endEmitted&&!ke.readableListening&&(ke.readableListening=ke.needReadable=!0,ke.flowing=!1,ke.emittedReadable=!1,y("on readable",ke.length,ke.reading),ke.length?b(this):ke.reading||i.nextTick(nt,this)),Se},fe.prototype.addListener=fe.prototype.on,fe.prototype.removeListener=function(P,V){const Se=v.prototype.removeListener.call(this,P,V);return P==="readable"&&i.nextTick(Pe,this),Se},fe.prototype.off=fe.prototype.removeListener,fe.prototype.removeAllListeners=function(P){const V=v.prototype.removeAllListeners.apply(this,arguments);return(P==="readable"||P===void 0)&&i.nextTick(Pe,this),V};function Pe(P){const V=P._readableState;V.readableListening=P.listenerCount("readable")>0,V.resumeScheduled&&V[$]===!1?V.flowing=!0:P.listenerCount("data")>0?P.resume():V.readableListening||(V.flowing=null)}function nt(P){y("readable nexttick read 0"),P.read(0)}fe.prototype.resume=function(){const P=this._readableState;return P.flowing||(y("resume"),P.flowing=!P.readableListening,Je(this,P)),P[$]=!1,this};function Je(P,V){V.resumeScheduled||(V.resumeScheduled=!0,i.nextTick(Ye,P,V))}function Ye(P,V){y("resume",V.reading),V.reading||P.read(0),V.resumeScheduled=!1,P.emit("resume"),Xe(P),V.flowing&&!V.reading&&P.read(0)}fe.prototype.pause=function(){return y("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(y("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[$]=!0,this};function Xe(P){const V=P._readableState;for(y("flow",V.flowing);V.flowing&&P.read()!==null;);}fe.prototype.wrap=function(P){let V=!1;P.on("data",ke=>{!this.push(ke)&&P.pause&&(V=!0,P.pause())}),P.on("end",()=>{this.push(null)}),P.on("error",ke=>{S(this,ke)}),P.on("close",()=>{this.destroy()}),P.on("destroy",()=>{this.destroy()}),this._read=()=>{V&&P.resume&&(V=!1,P.resume())};const Se=o(P);for(let ke=1;ke<Se.length;ke++){const Ce=Se[ke];this[Ce]===void 0&&typeof P[Ce]=="function"&&(this[Ce]=P[Ce].bind(P))}return this},fe.prototype[u]=function(){return Ii(this)},fe.prototype.iterator=function(P){return P!==void 0&&Q(P,"options"),Ii(this,P)};function Ii(P,V){typeof P.read!="function"&&(P=fe.wrap(P,{objectMode:!0}));const Se=cr(P,V);return Se.stream=P,Se}async function*cr(P,V){let Se=re;function ke(Mt){this===P?(Se(),Se=re):Se=Mt}P.on("readable",ke);let Ce;const Rt=k(P,{writable:!1},Mt=>{Ce=Mt?C(Ce,Mt):null,Se(),Se=re});try{for(;;){const Mt=P.destroyed?null:P.read();if(Mt!==null)yield Mt;else{if(Ce)throw Ce;if(Ce===null)return;await new c(ke)}}}catch(Mt){throw Ce=C(Ce,Mt),Ce}finally{(Ce||V?.destroyOnReturn!==!1)&&(Ce===void 0||P._readableState.autoDestroy)?m.destroyer(P,null):(P.off("readable",ke),Rt())}}s(fe.prototype,{readable:{__proto__:null,get(){const P=this._readableState;return!!P&&P.readable!==!1&&!P.destroyed&&!P.errorEmitted&&!P.endEmitted},set(P){this._readableState&&(this._readableState.readable=!!P)}},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(P){this._readableState&&(this._readableState.flowing=P)}},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(P){this._readableState&&(this._readableState.destroyed=P)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(Ee.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[$]!==!1},set(P){this[$]=!!P}}}),fe._fromList=ft;function ft(P,V){if(V.length===0)return null;let Se;return V.objectMode?Se=V.buffer.shift():!P||P>=V.length?(V.decoder?Se=V.buffer.join(""):V.buffer.length===1?Se=V.buffer.first():Se=V.buffer.concat(V.length),V.buffer.clear()):Se=V.buffer.consume(P,V.decoder),Se}function mt(P){const V=P._readableState;y("endReadable",V.endEmitted),V.endEmitted||(V.ended=!0,i.nextTick(Gs,V,P))}function Gs(P,V){if(y("endReadableNT",P.endEmitted,P.length),!P.errored&&!P.closeEmitted&&!P.endEmitted&&P.length===0){if(P.endEmitted=!0,V.emit("end"),V.writable&&V.allowHalfOpen===!1)i.nextTick(dr,V);else if(P.autoDestroy){const Se=V._writableState;(!Se||Se.autoDestroy&&(Se.finished||Se.writable===!1))&&V.destroy()}}}function dr(P){P.writable&&!P.writableEnded&&!P.destroyed&&P.end()}fe.from=function(P,V){return B(fe,P,V)};let Yr;function Mn(){return Yr===void 0&&(Yr={}),Yr}return fe.fromWeb=function(P,V){return Mn().newStreamReadableFromReadableStream(P,V)},fe.toWeb=function(P,V){return Mn().newReadableStreamFromStreamReadable(P,V)},fe.wrap=function(P,V){var Se,ke;return new fe({objectMode:(Se=(ke=P.readableObjectMode)!==null&&ke!==void 0?ke:P.objectMode)!==null&&Se!==void 0?Se:!0,...V,destroy(Ce,Rt){m.destroyer(P,Ce),Rt(Ce)}}).wrap(P)},_a}var xa,ru;function Lc(){if(ru)return xa;ru=1;const i=Gr(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:n,ObjectDefineProperties:s,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:a,Symbol:c,SymbolHasInstance:l}=ut();xa=Q,Q.WritableState=R;const{EventEmitter:d}=jo(),u=Dc().Stream,{Buffer:p}=sr(),g=$n(),{addAbortSignal:v}=Bo(),{getHighWaterMark:_,getDefaultHighWaterMark:E}=qo(),{ERR_INVALID_ARG_TYPE:x,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_MULTIPLE_CALLBACK:y,ERR_STREAM_CANNOT_PIPE:h,ERR_STREAM_DESTROYED:m,ERR_STREAM_ALREADY_FINISHED:T,ERR_STREAM_NULL_VALUES:N,ERR_STREAM_WRITE_AFTER_END:C,ERR_UNKNOWN_ENCODING:F}=Xt().codes,{errorOrDestroy:I}=g;o(Q.prototype,u.prototype),o(Q,u);function O(){}const U=c("kOnFinished");function R(M,K,ce){typeof ce!="boolean"&&(ce=K instanceof Zi()),this.objectMode=!!(M&&M.objectMode),ce&&(this.objectMode=this.objectMode||!!(M&&M.writableObjectMode)),this.highWaterMark=M?_(this,M,"writableHighWaterMark",ce):E(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const be=!!(M&&M.decodeStrings===!1);this.decodeStrings=!be,this.defaultEncoding=M&&M.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=S.bind(void 0,K),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,D(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!M||M.emitClose!==!1,this.autoDestroy=!M||M.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[U]=[]}function D(M){M.buffered=[],M.bufferedIndex=0,M.allBuffers=!0,M.allNoop=!0}R.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},n(R.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Q(M){const K=this instanceof Zi();if(!K&&!r(Q,this))return new Q(M);this._writableState=new R(M,this,K),M&&(typeof M.write=="function"&&(this._write=M.write),typeof M.writev=="function"&&(this._writev=M.writev),typeof M.destroy=="function"&&(this._destroy=M.destroy),typeof M.final=="function"&&(this._final=M.final),typeof M.construct=="function"&&(this._construct=M.construct),M.signal&&v(M.signal,this)),u.call(this,M),g.construct(this,()=>{const ce=this._writableState;ce.writing||he(this,ce),z(this,ce)})}n(Q,l,{__proto__:null,value:function(M){return r(this,M)?!0:this!==Q?!1:M&&M._writableState instanceof R}}),Q.prototype.pipe=function(){I(this,new h)};function $(M,K,ce,be){const ve=M._writableState;if(typeof ce=="function")be=ce,ce=ve.defaultEncoding;else{if(!ce)ce=ve.defaultEncoding;else if(ce!=="buffer"&&!p.isEncoding(ce))throw new F(ce);typeof be!="function"&&(be=O)}if(K===null)throw new N;if(!ve.objectMode)if(typeof K=="string")ve.decodeStrings!==!1&&(K=p.from(K,ce),ce="buffer");else if(K instanceof p)ce="buffer";else if(u._isUint8Array(K))K=u._uint8ArrayToBuffer(K),ce="buffer";else throw new x("chunk",["string","Buffer","Uint8Array"],K);let xe;return ve.ending?xe=new C:ve.destroyed&&(xe=new m("write")),xe?(i.nextTick(be,xe),I(M,xe,!0),xe):(ve.pendingcb++,Y(M,ve,K,ce,be))}Q.prototype.write=function(M,K,ce){return $(this,M,K,ce)===!0},Q.prototype.cork=function(){this._writableState.corked++},Q.prototype.uncork=function(){const M=this._writableState;M.corked&&(M.corked--,M.writing||he(this,M))},Q.prototype.setDefaultEncoding=function(K){if(typeof K=="string"&&(K=a(K)),!p.isEncoding(K))throw new F(K);return this._writableState.defaultEncoding=K,this};function Y(M,K,ce,be,ve){const xe=K.objectMode?1:ce.length;K.length+=xe;const ie=K.length<K.highWaterMark;return ie||(K.needDrain=!0),K.writing||K.corked||K.errored||!K.constructed?(K.buffered.push({chunk:ce,encoding:be,callback:ve}),K.allBuffers&&be!=="buffer"&&(K.allBuffers=!1),K.allNoop&&ve!==O&&(K.allNoop=!1)):(K.writelen=xe,K.writecb=ve,K.writing=!0,K.sync=!0,M._write(ce,be,K.onwrite),K.sync=!1),ie&&!K.errored&&!K.destroyed}function B(M,K,ce,be,ve,xe,ie){K.writelen=be,K.writecb=ie,K.writing=!0,K.sync=!0,K.destroyed?K.onwrite(new m("write")):ce?M._writev(ve,K.onwrite):M._write(ve,xe,K.onwrite),K.sync=!1}function re(M,K,ce,be){--K.pendingcb,be(ce),J(K),I(M,ce)}function S(M,K){const ce=M._writableState,be=ce.sync,ve=ce.writecb;if(typeof ve!="function"){I(M,new y);return}ce.writing=!1,ce.writecb=null,ce.length-=ce.writelen,ce.writelen=0,K?(K.stack,ce.errored||(ce.errored=K),M._readableState&&!M._readableState.errored&&(M._readableState.errored=K),be?i.nextTick(re,M,ce,K,ve):re(M,ce,K,ve)):(ce.buffered.length>ce.bufferedIndex&&he(M,ce),be?ce.afterWriteTickInfo!==null&&ce.afterWriteTickInfo.cb===ve?ce.afterWriteTickInfo.count++:(ce.afterWriteTickInfo={count:1,cb:ve,stream:M,state:ce},i.nextTick(H,ce.afterWriteTickInfo)):ee(M,ce,1,ve))}function H({stream:M,state:K,count:ce,cb:be}){return K.afterWriteTickInfo=null,ee(M,K,ce,be)}function ee(M,K,ce,be){for(!K.ending&&!M.destroyed&&K.length===0&&K.needDrain&&(K.needDrain=!1,M.emit("drain"));ce-- >0;)K.pendingcb--,be();K.destroyed&&J(K),z(M,K)}function J(M){if(M.writing)return;for(let ve=M.bufferedIndex;ve<M.buffered.length;++ve){var K;const{chunk:xe,callback:ie}=M.buffered[ve],me=M.objectMode?1:xe.length;M.length-=me,ie((K=M.errored)!==null&&K!==void 0?K:new m("write"))}const ce=M[U].splice(0);for(let ve=0;ve<ce.length;ve++){var be;ce[ve]((be=M.errored)!==null&&be!==void 0?be:new m("end"))}D(M)}function he(M,K){if(K.corked||K.bufferProcessing||K.destroyed||!K.constructed)return;const{buffered:ce,bufferedIndex:be,objectMode:ve}=K,xe=ce.length-be;if(!xe)return;let ie=be;if(K.bufferProcessing=!0,xe>1&&M._writev){K.pendingcb-=xe-1;const me=K.allNoop?O:fe=>{for(let Ve=ie;Ve<ce.length;++Ve)ce[Ve].callback(fe)},Ee=K.allNoop&&ie===0?ce:e(ce,ie);Ee.allBuffers=K.allBuffers,B(M,K,!0,K.length,Ee,"",me),D(K)}else{do{const{chunk:me,encoding:Ee,callback:fe}=ce[ie];ce[ie++]=null;const Ve=ve?1:me.length;B(M,K,!1,Ve,me,Ee,fe)}while(ie<ce.length&&!K.writing);ie===ce.length?D(K):ie>256?(ce.splice(0,ie),K.bufferedIndex=0):K.bufferedIndex=ie}K.bufferProcessing=!1}Q.prototype._write=function(M,K,ce){if(this._writev)this._writev([{chunk:M,encoding:K}],ce);else throw new k("_write()")},Q.prototype._writev=null,Q.prototype.end=function(M,K,ce){const be=this._writableState;typeof M=="function"?(ce=M,M=null,K=null):typeof K=="function"&&(ce=K,K=null);let ve;if(M!=null){const xe=$(this,M,K);xe instanceof t&&(ve=xe)}return be.corked&&(be.corked=1,this.uncork()),ve||(!be.errored&&!be.ending?(be.ending=!0,z(this,be,!0),be.ended=!0):be.finished?ve=new T("end"):be.destroyed&&(ve=new m("end"))),typeof ce=="function"&&(ve||be.finished?i.nextTick(ce,ve):be[U].push(ce)),this};function W(M){return M.ending&&!M.destroyed&&M.constructed&&M.length===0&&!M.errored&&M.buffered.length===0&&!M.finished&&!M.writing&&!M.errorEmitted&&!M.closeEmitted}function G(M,K){let ce=!1;function be(ve){if(ce){I(M,ve??y());return}if(ce=!0,K.pendingcb--,ve){const xe=K[U].splice(0);for(let ie=0;ie<xe.length;ie++)xe[ie](ve);I(M,ve,K.sync)}else W(K)&&(K.prefinished=!0,M.emit("prefinish"),K.pendingcb++,i.nextTick(ne,M,K))}K.sync=!0,K.pendingcb++;try{M._final(be)}catch(ve){be(ve)}K.sync=!1}function X(M,K){!K.prefinished&&!K.finalCalled&&(typeof M._final=="function"&&!K.destroyed?(K.finalCalled=!0,G(M,K)):(K.prefinished=!0,M.emit("prefinish")))}function z(M,K,ce){W(K)&&(X(M,K),K.pendingcb===0&&(ce?(K.pendingcb++,i.nextTick((be,ve)=>{W(ve)?ne(be,ve):ve.pendingcb--},M,K)):W(K)&&(K.pendingcb++,ne(M,K))))}function ne(M,K){K.pendingcb--,K.finished=!0;const ce=K[U].splice(0);for(let be=0;be<ce.length;be++)ce[be]();if(M.emit("finish"),K.autoDestroy){const be=M._readableState;(!be||be.autoDestroy&&(be.endEmitted||be.readable===!1))&&M.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(M){this._writableState&&(this._writableState.destroyed=M)}},writable:{__proto__:null,get(){const M=this._writableState;return!!M&&M.writable!==!1&&!M.destroyed&&!M.errored&&!M.ending&&!M.ended},set(M){this._writableState&&(this._writableState.writable=!!M)}},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 M=this._writableState;return M?!M.destroyed&&!M.ending&&M.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 se=g.destroy;Q.prototype.destroy=function(M,K){const ce=this._writableState;return!ce.destroyed&&(ce.bufferedIndex<ce.buffered.length||ce[U].length)&&i.nextTick(J,ce),se.call(this,M,K),this},Q.prototype._undestroy=g.undestroy,Q.prototype._destroy=function(M,K){K(M)},Q.prototype[d.captureRejectionSymbol]=function(M){this.destroy(M)};let ye;function _e(){return ye===void 0&&(ye={}),ye}return Q.fromWeb=function(M,K){return _e().newStreamWritableFromWritableStream(M,K)},Q.toWeb=function(M){return _e().newWritableStreamFromStreamWritable(M)},xa}var Ea,nu;function Ym(){if(nu)return Ea;nu=1;const i=Gr(),e=sr(),{isReadable:t,isWritable:r,isIterable:n,isNodeStream:s,isReadableNodeStream:o,isWritableNodeStream:a,isDuplexNodeStream:c,isReadableStream:l,isWritableStream:d}=or(),u=_r(),{AbortError:p,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:v}}=Xt(),{destroyer:_}=$n(),E=Zi(),x=Uo(),k=Lc(),{createDeferredPromise:y}=ei(),h=Gf(),m=globalThis.Blob||e.Blob,T=typeof m<"u"?function(R){return R instanceof m}:function(R){return!1},N=globalThis.AbortController||Rs().AbortController,{FunctionPrototypeCall:C}=ut();class F extends E{constructor(R){super(R),R?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),R?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Ea=function U(R,D){if(c(R))return R;if(o(R))return O({readable:R});if(a(R))return O({writable:R});if(s(R))return O({writable:!1,readable:!1});if(l(R))return O({readable:x.fromWeb(R)});if(d(R))return O({writable:k.fromWeb(R)});if(typeof R=="function"){const{value:$,write:Y,final:B,destroy:re}=I(R);if(n($))return h(F,$,{objectMode:!0,write:Y,final:B,destroy:re});const S=$?.then;if(typeof S=="function"){let H;const ee=C(S,$,J=>{if(J!=null)throw new v("nully","body",J)},J=>{_(H,J)});return H=new F({objectMode:!0,readable:!1,write:Y,final(J){B(async()=>{try{await ee,i.nextTick(J,null)}catch(he){i.nextTick(J,he)}})},destroy:re})}throw new v("Iterable, AsyncIterable or AsyncFunction",D,$)}if(T(R))return U(R.arrayBuffer());if(n(R))return h(F,R,{objectMode:!0,writable:!1});if(l(R?.readable)&&d(R?.writable))return F.fromWeb(R);if(typeof R?.writable=="object"||typeof R?.readable=="object"){const $=R!=null&&R.readable?o(R?.readable)?R?.readable:U(R.readable):void 0,Y=R!=null&&R.writable?a(R?.writable)?R?.writable:U(R.writable):void 0;return O({readable:$,writable:Y})}const Q=R?.then;if(typeof Q=="function"){let $;return C(Q,R,Y=>{Y!=null&&$.push(Y),$.push(null)},Y=>{_($,Y)}),$=new F({objectMode:!0,writable:!1,read(){}})}throw new g(D,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],R)};function I(U){let{promise:R,resolve:D}=y();const Q=new N,$=Q.signal;return{value:U(async function*(){for(;;){const B=R;R=null;const{chunk:re,done:S,cb:H}=await B;if(i.nextTick(H),S)return;if($.aborted)throw new p(void 0,{cause:$.reason});({promise:R,resolve:D}=y()),yield re}}(),{signal:$}),write(B,re,S){const H=D;D=null,H({chunk:B,done:!1,cb:S})},final(B){const re=D;D=null,re({done:!0,cb:B})},destroy(B,re){Q.abort(),re(B)}}}function O(U){const R=U.readable&&typeof U.readable.read!="function"?x.wrap(U.readable):U.readable,D=U.writable;let Q=!!t(R),$=!!r(D),Y,B,re,S,H;function ee(J){const he=S;S=null,he?he(J):J&&H.destroy(J)}return H=new F({readableObjectMode:!!(R!=null&&R.readableObjectMode),writableObjectMode:!!(D!=null&&D.writableObjectMode),readable:Q,writable:$}),$&&(u(D,J=>{$=!1,J&&_(R,J),ee(J)}),H._write=function(J,he,W){D.write(J,he)?W():Y=W},H._final=function(J){D.end(),B=J},D.on("drain",function(){if(Y){const J=Y;Y=null,J()}}),D.on("finish",function(){if(B){const J=B;B=null,J()}})),Q&&(u(R,J=>{Q=!1,J&&_(R,J),ee(J)}),R.on("readable",function(){if(re){const J=re;re=null,J()}}),R.on("end",function(){H.push(null)}),H._read=function(){for(;;){const J=R.read();if(J===null){re=H._read;return}if(!H.push(J))return}}),H._destroy=function(J,he){!J&&S!==null&&(J=new p),re=null,Y=null,B=null,S===null?he(J):(S=he,_(D,J),_(R,J))},H}return Ea}var Sa,su;function Zi(){if(su)return Sa;su=1;const{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:r}=ut();Sa=o;const n=Uo(),s=Lc();r(o.prototype,n.prototype),r(o,n);{const d=t(s.prototype);for(let u=0;u<d.length;u++){const p=d[u];o.prototype[p]||(o.prototype[p]=s.prototype[p])}}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 c(){return a===void 0&&(a={}),a}o.fromWeb=function(d,u){return c().newStreamDuplexFromReadableWritablePair(d,u)},o.toWeb=function(d){return c().newReadableWritablePairFromDuplex(d)};let l;return o.from=function(d){return l||(l=Ym()),l(d,"body")},Sa}var ka,ou;function Kf(){if(ou)return ka;ou=1;const{ObjectSetPrototypeOf:i,Symbol:e}=ut();ka=o;const{ERR_METHOD_NOT_IMPLEMENTED:t}=Xt().codes,r=Zi(),{getHighWaterMark:n}=qo();i(o.prototype,r.prototype),i(o,r);const s=e("kCallback");function o(l){if(!(this instanceof o))return new o(l);const d=l?n(this,l,"readableHighWaterMark",!0):null;d===0&&(l={...l,highWaterMark:null,readableHighWaterMark:d,writableHighWaterMark:l.writableHighWaterMark||0}),r.call(this,l),this._readableState.sync=!1,this[s]=null,l&&(typeof l.transform=="function"&&(this._transform=l.transform),typeof l.flush=="function"&&(this._flush=l.flush)),this.on("prefinish",c)}function a(l){typeof this._flush=="function"&&!this.destroyed?this._flush((d,u)=>{if(d){l?l(d):this.destroy(d);return}u!=null&&this.push(u),this.push(null),l&&l()}):(this.push(null),l&&l())}function c(){this._final!==a&&a.call(this)}return o.prototype._final=a,o.prototype._transform=function(l,d,u){throw new t("_transform()")},o.prototype._write=function(l,d,u){const p=this._readableState,g=this._writableState,v=p.length;this._transform(l,d,(_,E)=>{if(_){u(_);return}E!=null&&this.push(E),g.ended||v===p.length||p.length<p.highWaterMark?u():this[s]=u})},o.prototype._read=function(){if(this[s]){const l=this[s];this[s]=null,l()}},ka}var Ra,au;function Xf(){if(au)return Ra;au=1;const{ObjectSetPrototypeOf:i}=ut();Ra=t;const e=Kf();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)},Ra}var Ia,lu;function Oc(){if(lu)return Ia;lu=1;const i=Gr(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:r,SymbolDispose:n}=ut(),s=_r(),{once:o}=ei(),a=$n(),c=Zi(),{aggregateTwoErrors:l,codes:{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_RETURN_VALUE:u,ERR_MISSING_ARGS:p,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:_}=Xt(),{validateFunction:E,validateAbortSignal:x}=Fs(),{isIterable:k,isReadable:y,isReadableNodeStream:h,isNodeStream:m,isTransformStream:T,isWebStream:N,isReadableStream:C,isReadableFinished:F}=or(),I=globalThis.AbortController||Rs().AbortController;let O,U,R;function D(J,he,W){let G=!1;J.on("close",()=>{G=!0});const X=s(J,{readable:he,writable:W},z=>{G=!z});return{destroy:z=>{G||(G=!0,a.destroyer(J,z||new g("pipe")))},cleanup:X}}function Q(J){return E(J[J.length-1],"streams[stream.length - 1]"),J.pop()}function $(J){if(k(J))return J;if(h(J))return Y(J);throw new d("val",["Readable","Iterable","AsyncIterable"],J)}async function*Y(J){U||(U=Uo()),yield*U.prototype[r].call(J)}async function B(J,he,W,{end:G}){let X,z=null;const ne=_e=>{if(_e&&(X=_e),z){const M=z;z=null,M()}},se=()=>new t((_e,M)=>{X?M(X):z=()=>{X?M(X):_e()}});he.on("drain",ne);const ye=s(he,{readable:!1},ne);try{he.writableNeedDrain&&await se();for await(const _e of J)he.write(_e)||await se();G&&(he.end(),await se()),W()}catch(_e){W(X!==_e?l(X,_e):_e)}finally{ye(),he.off("drain",ne)}}async function re(J,he,W,{end:G}){T(he)&&(he=he.writable);const X=he.getWriter();try{for await(const z of J)await X.ready,X.write(z).catch(()=>{});await X.ready,G&&await X.close(),W()}catch(z){try{await X.abort(z),W(z)}catch(ne){W(ne)}}}function S(...J){return H(J,o(Q(J)))}function H(J,he,W){if(J.length===1&&e(J[0])&&(J=J[0]),J.length<2)throw new p("streams");const G=new I,X=G.signal,z=W?.signal,ne=[];x(z,"options.signal");function se(){ve(new _)}R=R||ei().addAbortListener;let ye;z&&(ye=R(z,se));let _e,M;const K=[];let ce=0;function be(Ee){ve(Ee,--ce===0)}function ve(Ee,fe){var Ve;if(Ee&&(!_e||_e.code==="ERR_STREAM_PREMATURE_CLOSE")&&(_e=Ee),!(!_e&&!fe)){for(;K.length;)K.shift()(_e);(Ve=ye)===null||Ve===void 0||Ve[n](),G.abort(),fe&&(_e||ne.forEach(kt=>kt()),i.nextTick(he,_e,M))}}let xe;for(let Ee=0;Ee<J.length;Ee++){const fe=J[Ee],Ve=Ee<J.length-1,kt=Ee>0,Ue=Ve||W?.end!==!1,Nt=Ee===J.length-1;if(m(fe)){let A=function(f){f&&f.name!=="AbortError"&&f.code!=="ERR_STREAM_PREMATURE_CLOSE"&&be(f)};if(Ue){const{destroy:f,cleanup:b}=D(fe,Ve,kt);K.push(f),y(fe)&&Nt&&ne.push(b)}fe.on("error",A),y(fe)&&Nt&&ne.push(()=>{fe.removeListener("error",A)})}if(Ee===0)if(typeof fe=="function"){if(xe=fe({signal:X}),!k(xe))throw new u("Iterable, AsyncIterable or Stream","source",xe)}else k(fe)||h(fe)||T(fe)?xe=fe:xe=c.from(fe);else if(typeof fe=="function"){if(T(xe)){var ie;xe=$((ie=xe)===null||ie===void 0?void 0:ie.readable)}else xe=$(xe);if(xe=fe(xe,{signal:X}),Ve){if(!k(xe,!0))throw new u("AsyncIterable",`transform[${Ee-1}]`,xe)}else{var me;O||(O=Xf());const A=new O({objectMode:!0}),f=(me=xe)===null||me===void 0?void 0:me.then;if(typeof f=="function")ce++,f.call(xe,te=>{M=te,te!=null&&A.write(te),Ue&&A.end(),i.nextTick(be)},te=>{A.destroy(te),i.nextTick(be,te)});else if(k(xe,!0))ce++,B(xe,A,be,{end:Ue});else if(C(xe)||T(xe)){const te=xe.readable||xe;ce++,B(te,A,be,{end:Ue})}else throw new u("AsyncIterable or Promise","destination",xe);xe=A;const{destroy:b,cleanup:j}=D(xe,!1,!0);K.push(b),Nt&&ne.push(j)}}else if(m(fe)){if(h(xe)){ce+=2;const A=ee(xe,fe,be,{end:Ue});y(fe)&&Nt&&ne.push(A)}else if(T(xe)||C(xe)){const A=xe.readable||xe;ce++,B(A,fe,be,{end:Ue})}else if(k(xe))ce++,B(xe,fe,be,{end:Ue});else throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],xe);xe=fe}else if(N(fe)){if(h(xe))ce++,re($(xe),fe,be,{end:Ue});else if(C(xe)||k(xe))ce++,re(xe,fe,be,{end:Ue});else if(T(xe))ce++,re(xe.readable,fe,be,{end:Ue});else throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],xe);xe=fe}else xe=c.from(fe)}return(X!=null&&X.aborted||z!=null&&z.aborted)&&i.nextTick(se),xe}function ee(J,he,W,{end:G}){let X=!1;if(he.on("close",()=>{X||W(new v)}),J.pipe(he,{end:!1}),G){let z=function(){X=!0,he.end()};F(J)?i.nextTick(z):J.once("end",z)}else W();return s(J,{readable:!0,writable:!1},z=>{const ne=J._readableState;z&&z.code==="ERR_STREAM_PREMATURE_CLOSE"&&ne&&ne.ended&&!ne.errored&&!ne.errorEmitted?J.once("end",W).once("error",W):W(z)}),s(he,{readable:!1,writable:!0},W)}return Ia={pipelineImpl:H,pipeline:S},Ia}var Ta,cu;function Jf(){if(cu)return Ta;cu=1;const{pipeline:i}=Oc(),e=Zi(),{destroyer:t}=$n(),{isNodeStream:r,isReadable:n,isWritable:s,isWebStream:o,isTransformStream:a,isWritableStream:c,isReadableStream:l}=or(),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:u,ERR_MISSING_ARGS:p}}=Xt(),g=_r();return Ta=function(..._){if(_.length===0)throw new p("streams");if(_.length===1)return e.from(_[0]);const E=[..._];if(typeof _[0]=="function"&&(_[0]=e.from(_[0])),typeof _[_.length-1]=="function"){const O=_.length-1;_[O]=e.from(_[O])}for(let O=0;O<_.length;++O)if(!(!r(_[O])&&!o(_[O]))){if(O<_.length-1&&!(n(_[O])||l(_[O])||a(_[O])))throw new u(`streams[${O}]`,E[O],"must be readable");if(O>0&&!(s(_[O])||c(_[O])||a(_[O])))throw new u(`streams[${O}]`,E[O],"must be writable")}let x,k,y,h,m;function T(O){const U=h;h=null,U?U(O):O?m.destroy(O):!I&&!F&&m.destroy()}const N=_[0],C=i(_,T),F=!!(s(N)||c(N)||a(N)),I=!!(n(C)||l(C)||a(C));if(m=new e({writableObjectMode:!!(N!=null&&N.writableObjectMode),readableObjectMode:!!(C!=null&&C.readableObjectMode),writable:F,readable:I}),F){if(r(N))m._write=function(U,R,D){N.write(U,R)?D():x=D},m._final=function(U){N.end(),k=U},N.on("drain",function(){if(x){const U=x;x=null,U()}});else if(o(N)){const R=(a(N)?N.writable:N).getWriter();m._write=async function(D,Q,$){try{await R.ready,R.write(D).catch(()=>{}),$()}catch(Y){$(Y)}},m._final=async function(D){try{await R.ready,R.close().catch(()=>{}),k=D}catch(Q){D(Q)}}}const O=a(C)?C.readable:C;g(O,()=>{if(k){const U=k;k=null,U()}})}if(I){if(r(C))C.on("readable",function(){if(y){const O=y;y=null,O()}}),C.on("end",function(){m.push(null)}),m._read=function(){for(;;){const O=C.read();if(O===null){y=m._read;return}if(!m.push(O))return}};else if(o(C)){const U=(a(C)?C.readable:C).getReader();m._read=async function(){for(;;)try{const{value:R,done:D}=await U.read();if(!m.push(R))return;if(D){m.push(null);return}}catch{return}}}}return m._destroy=function(O,U){!O&&h!==null&&(O=new d),y=null,x=null,k=null,h===null?U(O):(h=U,r(C)&&t(C,O))},m},Ta}var du;function Zm(){if(du)return to;du=1;const i=globalThis.AbortController||Rs().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:n},AbortError:s}=Xt(),{validateAbortSignal:o,validateInteger:a,validateObject:c}=Fs(),l=ut().Symbol("kWeak"),d=ut().Symbol("kResistStopPropagation"),{finished:u}=_r(),p=Jf(),{addAbortSignalNoValidate:g}=Bo(),{isWritable:v,isNodeStream:_}=or(),{deprecate:E}=ei(),{ArrayPrototypePush:x,Boolean:k,MathFloor:y,Number:h,NumberIsNaN:m,Promise:T,PromiseReject:N,PromiseResolve:C,PromisePrototypeThen:F,Symbol:I}=ut(),O=I("kEmpty"),U=I("kEof");function R(z,ne){if(ne!=null&&c(ne,"options"),ne?.signal!=null&&o(ne.signal,"options.signal"),_(z)&&!v(z))throw new e("stream",z,"must be writable");const se=p(this,z);return ne!=null&&ne.signal&&g(ne.signal,se),se}function D(z,ne){if(typeof z!="function")throw new t("fn",["Function","AsyncFunction"],z);ne!=null&&c(ne,"options"),ne?.signal!=null&&o(ne.signal,"options.signal");let se=1;ne?.concurrency!=null&&(se=y(ne.concurrency));let ye=se-1;return ne?.highWaterMark!=null&&(ye=y(ne.highWaterMark)),a(se,"options.concurrency",1),a(ye,"options.highWaterMark",0),ye+=se,(async function*(){const M=ei().AbortSignalAny([ne?.signal].filter(k)),K=this,ce=[],be={signal:M};let ve,xe,ie=!1,me=0;function Ee(){ie=!0,fe()}function fe(){me-=1,Ve()}function Ve(){xe&&!ie&&me<se&&ce.length<ye&&(xe(),xe=null)}async function kt(){try{for await(let Ue of K){if(ie)return;if(M.aborted)throw new s;try{if(Ue=z(Ue,be),Ue===O)continue;Ue=C(Ue)}catch(Nt){Ue=N(Nt)}me+=1,F(Ue,fe,Ee),ce.push(Ue),ve&&(ve(),ve=null),!ie&&(ce.length>=ye||me>=se)&&await new T(Nt=>{xe=Nt})}ce.push(U)}catch(Ue){const Nt=N(Ue);F(Nt,fe,Ee),ce.push(Nt)}finally{ie=!0,ve&&(ve(),ve=null)}}kt();try{for(;;){for(;ce.length>0;){const Ue=await ce[0];if(Ue===U)return;if(M.aborted)throw new s;Ue!==O&&(yield Ue),ce.shift(),Ve()}await new T(Ue=>{ve=Ue})}}finally{ie=!0,xe&&(xe(),xe=null)}}).call(this)}function Q(z=void 0){return z!=null&&c(z,"options"),z?.signal!=null&&o(z.signal,"options.signal"),(async function*(){let se=0;for await(const _e of this){var ye;if(z!=null&&(ye=z.signal)!==null&&ye!==void 0&&ye.aborted)throw new s({cause:z.signal.reason});yield[se++,_e]}}).call(this)}async function $(z,ne=void 0){for await(const se of S.call(this,z,ne))return!0;return!1}async function Y(z,ne=void 0){if(typeof z!="function")throw new t("fn",["Function","AsyncFunction"],z);return!await $.call(this,async(...se)=>!await z(...se),ne)}async function B(z,ne){for await(const se of S.call(this,z,ne))return se}async function re(z,ne){if(typeof z!="function")throw new t("fn",["Function","AsyncFunction"],z);async function se(ye,_e){return await z(ye,_e),O}for await(const ye of D.call(this,se,ne));}function S(z,ne){if(typeof z!="function")throw new t("fn",["Function","AsyncFunction"],z);async function se(ye,_e){return await z(ye,_e)?ye:O}return D.call(this,se,ne)}class H extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function ee(z,ne,se){var ye;if(typeof z!="function")throw new t("reducer",["Function","AsyncFunction"],z);se!=null&&c(se,"options"),se?.signal!=null&&o(se.signal,"options.signal");let _e=arguments.length>1;if(se!=null&&(ye=se.signal)!==null&&ye!==void 0&&ye.aborted){const ve=new s(void 0,{cause:se.signal.reason});throw this.once("error",()=>{}),await u(this.destroy(ve)),ve}const M=new i,K=M.signal;if(se!=null&&se.signal){const ve={once:!0,[l]:this,[d]:!0};se.signal.addEventListener("abort",()=>M.abort(),ve)}let ce=!1;try{for await(const ve of this){var be;if(ce=!0,se!=null&&(be=se.signal)!==null&&be!==void 0&&be.aborted)throw new s;_e?ne=await z(ne,ve,{signal:K}):(ne=ve,_e=!0)}if(!ce&&!_e)throw new H}finally{M.abort()}return ne}async function J(z){z!=null&&c(z,"options"),z?.signal!=null&&o(z.signal,"options.signal");const ne=[];for await(const ye of this){var se;if(z!=null&&(se=z.signal)!==null&&se!==void 0&&se.aborted)throw new s(void 0,{cause:z.signal.reason});x(ne,ye)}return ne}function he(z,ne){const se=D.call(this,z,ne);return(async function*(){for await(const _e of se)yield*_e}).call(this)}function W(z){if(z=h(z),m(z))return 0;if(z<0)throw new n("number",">= 0",z);return z}function G(z,ne=void 0){return ne!=null&&c(ne,"options"),ne?.signal!=null&&o(ne.signal,"options.signal"),z=W(z),(async function*(){var ye;if(ne!=null&&(ye=ne.signal)!==null&&ye!==void 0&&ye.aborted)throw new s;for await(const M of this){var _e;if(ne!=null&&(_e=ne.signal)!==null&&_e!==void 0&&_e.aborted)throw new s;z--<=0&&(yield M)}}).call(this)}function X(z,ne=void 0){return ne!=null&&c(ne,"options"),ne?.signal!=null&&o(ne.signal,"options.signal"),z=W(z),(async function*(){var ye;if(ne!=null&&(ye=ne.signal)!==null&&ye!==void 0&&ye.aborted)throw new s;for await(const M of this){var _e;if(ne!=null&&(_e=ne.signal)!==null&&_e!==void 0&&_e.aborted)throw new s;if(z-- >0&&(yield M),z<=0)return}}).call(this)}return to.streamReturningOperators={asIndexedPairs:E(Q,"readable.asIndexedPairs will be removed in a future version."),drop:G,filter:S,flatMap:he,map:D,take:X,compose:R},to.promiseReturningOperators={every:Y,forEach:re,reduce:ee,toArray:J,some:$,find:B},to}var Ca,uu;function Qf(){if(uu)return Ca;uu=1;const{ArrayPrototypePop:i,Promise:e}=ut(),{isIterable:t,isNodeStream:r,isWebStream:n}=or(),{pipelineImpl:s}=Oc(),{finished:o}=_r();Yf();function a(...c){return new e((l,d)=>{let u,p;const g=c[c.length-1];if(g&&typeof g=="object"&&!r(g)&&!t(g)&&!n(g)){const v=i(c);u=v.signal,p=v.end}s(c,(v,_)=>{v?d(v):l(_)},{signal:u,end:p})})}return Ca={finished:o,pipeline:a},Ca}var hu;function Yf(){if(hu)return oa.exports;hu=1;const{Buffer:i}=sr(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:r}=ut(),{promisify:{custom:n}}=ei(),{streamReturningOperators:s,promiseReturningOperators:o}=Zm(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:a}}=Xt(),c=Jf(),{setDefaultHighWaterMark:l,getDefaultHighWaterMark:d}=qo(),{pipeline:u}=Oc(),{destroyer:p}=$n(),g=_r(),v=Qf(),_=or(),E=oa.exports=Dc().Stream;E.isDestroyed=_.isDestroyed,E.isDisturbed=_.isDisturbed,E.isErrored=_.isErrored,E.isReadable=_.isReadable,E.isWritable=_.isWritable,E.Readable=Uo();for(const k of t(s)){let h=function(...m){if(new.target)throw a();return E.Readable.from(r(y,this,m))};const y=s[k];e(h,"name",{__proto__:null,value:y.name}),e(h,"length",{__proto__:null,value:y.length}),e(E.Readable.prototype,k,{__proto__:null,value:h,enumerable:!1,configurable:!0,writable:!0})}for(const k of t(o)){let h=function(...m){if(new.target)throw a();return r(y,this,m)};const y=o[k];e(h,"name",{__proto__:null,value:y.name}),e(h,"length",{__proto__:null,value:y.length}),e(E.Readable.prototype,k,{__proto__:null,value:h,enumerable:!1,configurable:!0,writable:!0})}E.Writable=Lc(),E.Duplex=Zi(),E.Transform=Kf(),E.PassThrough=Xf(),E.pipeline=u;const{addAbortSignal:x}=Bo();return E.addAbortSignal=x,E.finished=g,E.destroy=p,E.compose=c,E.setDefaultHighWaterMark=l,E.getDefaultHighWaterMark=d,e(E,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return v}}),e(u,n,{__proto__:null,enumerable:!0,get(){return v.pipeline}}),e(g,n,{__proto__:null,enumerable:!0,get(){return v.finished}}),E.Stream=E,E._isUint8Array=function(y){return y instanceof Uint8Array},E._uint8ArrayToBuffer=function(y){return i.from(y.buffer,y.byteOffset,y.byteLength)},oa.exports}var fu;function Zf(){return fu||(fu=1,function(i){const e=Yf(),t=Qf(),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}(sa)),sa.exports}var ep=Zf();const $a=Symbol("iter");function ms(i,e,t=4){if(t===0)return Object.assign(i,e);for(const r in e)i[r]=ms(i[r]||Object.create(null),e[r],t-1);return i}function tp(i,e,t=4){let r=!1;for(const n in i)if(n in e){const s=t===0?null:tp(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 ip(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:ms({},i[n],t-1);else if(t!==0){const s=ip(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 eg{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||He}_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 us(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&&(Ql(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${t}.${r}.${n}.${s}`:`.${t}.${r}.${n}`]}return this._ids[dn(e)]}_termToNewNumericId(e){const t=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${Ql(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:dn(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 jt{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||He,this._entityIndex=t.entityIndex||new eg({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,c){let l,d,u;const p=this._entities,g=this._termFromId(p[c]),v={subject:null,predicate:null,object:null};t&&((l=e,e={})[t]=l[t]);for(const _ in e)if(d=e[_]){v[s]=this._termFromId(p[_]),r&&((l=d,d={})[r]=l[r]);for(const E in d)if(u=d[E]){v[o]=this._termFromId(p[E]);const x=n?n in u?[n]:[]:Object.keys(u);for(let k=0;k<x.length;k++)v[a]=this._termFromId(p[x[k]]),yield this._factory.quad(v.subject,v.predicate,v.object,g)}}}_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,c;t&&((o=e,e={})[t]=o[t]);for(const l in e)if(a=e[l]){r&&((o=a,a={})[r]=o[r]);for(const d in a)(c=a[d])&&(n?n in c&&s++:s+=Object.keys(c).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,c;if(!(e=e&&this._termToNumericId(e))||!(t=t&&this._termToNumericId(t))||!(r=r&&this._termToNumericId(r))||!(o=s[n])||!(a=o.subjects[e])||!(c=a[t])||!(r in c))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 ep.Readable({objectMode:!0}),o=this.readQuads(e,t,r,n);return s._read=a=>{for(;--a>=0;){const{done:c,value:l}=o.next();if(c){s.push(null);return}s.push(l)}},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,c,l;if(!(e&&!(a=this._termToNumericId(e))||t&&!(c=this._termToNumericId(t))||r&&!(l=this._termToNumericId(r))))for(const d in s)(o=s[d])&&(a?l?yield*this._findInIndex(o.objects,l,a,c,"object","subject","predicate",d):yield*this._findInIndex(o.subjects,a,c,null,"subject","predicate","object",d):c?yield*this._findInIndex(o.predicates,c,l,null,"predicate","object","subject",d):l?yield*this._findInIndex(o.objects,l,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 fr(this,e,t,r,n,{entityIndex:this._entityIndex})}countQuads(e,t,r,n){const s=this._getGraphs(n);let o=0,a,c,l,d;if(e&&!(c=this._termToNumericId(e))||t&&!(l=this._termToNumericId(t))||r&&!(d=this._termToNumericId(r)))return 0;for(const u in s)(a=s[u])&&(e?r?o+=this._countInIndex(a.objects,d,c,l):o+=this._countInIndex(a.subjects,c,l,d):t?o+=this._countInIndex(a.predicates,l,d,c):o+=this._countInIndex(a.objects,d,c,l));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,c;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||r&&!(c=this._termToNumericId(r))))for(n in s)(o=s[n])&&(a?c?this._loopBy2Keys(o.predicates,a,c,e):this._loopByKey1(o.subjects,a,e):c?this._loopByKey0(o.objects,c,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,c;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||r&&!(c=this._termToNumericId(r))))for(n in s)(o=s[n])&&(a?c?this._loopBy2Keys(o.objects,c,a,e):this._loopByKey0(o.subjects,a,e):c?this._loopByKey1(o.predicates,c,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,c;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||r&&!(c=this._termToNumericId(r))))for(n in s)(o=s[n])&&(a?c?this._loopBy2Keys(o.subjects,a,c,e):this._loopByKey1(o.objects,a,e):c?this._loopByKey0(o.predicates,c,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,c)=>{throw new Error(`${a.value} ${c}`)},s=this.getQuads(null,Lt.rdf.rest,Lt.rdf.nil,null),o=e?[...s]:[];return s.forEach(a=>{const c=[];let l=!1,d,u;const p=a.graph;let g=a.subject;for(;g&&!l;){const v=this.getQuads(null,null,g,null),_=this.getQuads(g,null,null,null);let E,x=null,k=null,y=null;for(let h=0;h<_.length&&!l;h++)E=_[h],E.graph.equals(p)?d?l=n(g,"has non-list arcs out"):E.predicate.value===Lt.rdf.first?x?l=n(g,"has multiple rdf:first arcs"):o.push(x=E):E.predicate.value===Lt.rdf.rest?k?l=n(g,"has multiple rdf:rest arcs"):o.push(k=E):v.length?l=n(g,"can't be subject and object"):(d=E,u="subject"):l=n(g,"not confined to single graph");for(let h=0;h<v.length&&!l;++h)E=v[h],d?l=n(g,"can't have coreferences"):E.predicate.value===Lt.rdf.rest?y?l=n(g,"has incoming rdf:rest arcs"):y=E:(d=E,u="object");x?c.unshift(x.object):l=n(g,"has no list head"),g=y&&y.subject}l?e=!1:d&&(r[d[u].value]=c)}),e&&this.removeQuads(o),r}addAll(e){if(e instanceof fr&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof jt&&e._entityIndex===this._entityIndex)e._size!==0&&(this._graphs=ms(this._graphs,e._graphs),this._size=null);else for(const t of e)this.add(t);return this}contains(e){if(e instanceof fr&&(e=e.filtered),e===this)return!0;if(!(e instanceof jt)||this._entityIndex!==e._entityIndex)return e.every(l=>this.has(l));const t=this._graphs,r=e._graphs;let n,s,o,a,c;for(const l in r){if(!(n=t[l]))return!1;n=n.subjects;for(const d in s=r[l].subjects){if(!(o=n[d]))return!1;for(const u in a=s[d]){if(!(c=o[u]))return!1;for(const p in a[u])if(!(p in c))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 fr&&(e=e.filtered),e===this)return new jt({entityIndex:this._entityIndex});if(e instanceof jt&&e._entityIndex===this._entityIndex){const t=new jt({entityIndex:this._entityIndex}),r=ip(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 fr&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new jt({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&t.add(r);return t}intersection(e){if(e instanceof fr&&(e=e.filtered),e===this){const t=new jt({entityIndex:this._entityIndex});return t._graphs=ms(Object.create(null),this._graphs),t._size=this._size,t}else if(e instanceof jt&&this._entityIndex===e._entityIndex){const t=new jt({entityIndex:this._entityIndex}),r=tp(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 jt({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 Nc().quadsToString(this)}union(e){const t=new jt({entityIndex:this._entityIndex});return t._graphs=ms(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function Pi(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:Pi(i[s],e,t+1);o!==!1&&(n=n||Object.create(null),n[s]=o)}return n}class fr extends ep.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 jt({factory:e._factory,entityIndex:this.options.entityIndex});let a,c,l;if(s&&!(a=o._termToNumericId(s))||n&&!(c=o._termToNumericId(n))||r&&!(l=o._termToNumericId(r)))return o;const d=e._getGraphs(t);for(const u in d){let p,g,v,_;(_=d[u])&&(!a&&c?(g=Pi(_.predicates,[c,l,a]))&&(p=Pi(_.subjects,[a,c,l]),v=Pi(_.objects,[l,a,c])):l?(v=Pi(_.objects,[l,a,c]))&&(p=Pi(_.subjects,[a,c,l]),g=Pi(_.predicates,[c,l,a])):(p=Pi(_.subjects,[a,c,l]))&&(g=Pi(_.predicates,[c,l,a]),v=Pi(_.objects,[l,a,c])),p&&(o._graphs[u]={subjects:p,predicates:g,objects:v}))}o._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[$a]&&(this[$a]=this[Symbol.iterator]());const t=this[$a];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 Nc().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 fr(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 Oe="http://www.w3.org/ns/shacl#",pu="http://datashapes.org/dash#",br="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#",Fc="http://www.w3.org/2004/02/skos/core#",tg="http://www.w3.org/2002/07/owl#",ig="http://www.w3.org/ns/oa#",rg="http://purl.org/dc/terms/",ng="http://xmlns.com/foaf/0.1/",xo=He.namedNode("loaded-shapes"),Fi=He.namedNode("loaded-data"),qt=He.namedNode(Pc+"type"),Yl=He.namedNode(rg+"conformsTo"),mu=He.namedNode(Mc+"subClassOf"),jc=He.namedNode(tg+"imports"),sg=He.namedNode(Fc+"broader"),og=He.namedNode(Fc+"narrower"),no=He.namedNode(Oe+"NodeShape"),ag=He.namedNode(Oe+"IRI"),Eo=He.namedNode(Oe+"property"),Bc=He.namedNode(Oe+"class"),Is=He.namedNode(Oe+"targetClass"),lg=He.namedNode(Oe+"nodeKind"),cg=He.namedNode(br+"string");function gs(i,e,t=Oe,r){let n="";const s=dg(i,e,t,r);return s&&(n=s.value),n}function dg(i,e,t=Oe,r){let n;const s=t+e;if(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 ug(i){i.querySelector("input,select,textarea")?.focus()}function js(i,e){return gs(i,"prefLabel",Fc,e)||gs(i,"label",Mc,e)||gs(i,"name",ng,e)}function rp(i,e,t){const r=[];for(const n of i)r.push({value:n,label:js(e.getQuads(n,null,null,null),t),children:[]});return r}function Zl(i,e){for(const t in e)i=i.replace(e[t],"");return i}function np(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(qt,i,s)));e.parent&&np(i,e.parent,t,r,n)}function qc(i,e){if(e.shaclIn){const t=e.config.lists[e.shaclIn];return rp(t?.length?t:[],e.config.store,e.config.languages)}else{const t=e.config.store.getSubjects(qt,i,xo);t.push(...e.config.store.getSubjects(qt,i,Fi)),np(i,e,e.config.store,t);const r=new Map,n=new Map;for(const o of t)r.set(o.id,{value:o,label:js(e.config.store.getQuads(o,null,null,null),e.config.languages),children:[]});for(const o of t){for(const a of e.config.store.getObjects(o,sg,null))r.has(a.id)&&n.set(o.id,a.id);for(const a of e.config.store.getObjects(o,og,null))r.has(a.id)&&n.set(a.id,o.id);for(const a of e.config.store.getObjects(o,mu,null))r.has(a.id)&&n.set(o.id,a.id)}for(const[o,a]of n.entries())r.get(a)?.children?.push(r.get(o));const s=[];for(const[o,a]of r.entries())n.has(o)||s.push(a);for(const o of e.config.store.getSubjects(mu,i,null))s.push(...qc(o,e));return s}}function ec(i){let e;try{e=new URL(i)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function gu(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 sp(i,e,t){const r=document.createElement("div");r.classList.add("shacl-or-constraint");const n=[];if(e instanceof yr){const s=[];let o=!1;i.length&&(o=t.store.countQuads(i[0],Eo,null,null)>0);for(let l=0;l<i.length;l++)if(o){const d=t.store.getObjects(i[l],Eo,null),u=[];let p="";for(const g of d){const v=new Ro(g,e,t);u.push(v),p+=(p.length>1?" / ":"")+v.template.label}s.push(u),n.push({label:p,value:l.toString()})}else{const d=new Ro(i[l],e,t);s.push([d]),n.push({label:d.template.label,value:l.toString()})}const a=t.theme.createListEditor("Please choose",null,!1,n),c=a.querySelector(".editor");c.onchange=()=>{if(c.value){const l=s[parseInt(c.value)];let d;l.length&&(d=l[0],r.replaceWith(l[0]));for(let u=1;u<l.length;u++)d.after(l[u]),d=l[u]}},r.appendChild(a)}else{const s=[];for(let c=0;c<i.length;c++){const l=t.store.getQuads(i[c],null,null,null);l.length&&(s.push(l),n.push({label:js(l,t.languages)||Zl(l[0].predicate.value,t.prefixes)+" = "+Zl(l[0].object.value,t.prefixes),value:c.toString()}))}const o=t.theme.createListEditor(e.template.label+"?",null,!1,n,e.template),a=o.querySelector(".editor");a.onchange=()=>{a.value&&r.replaceWith(go(e.template.clone().merge(s[parseInt(a.value)]),void 0,!0))},r.appendChild(o)}return r}function hg(i,e,t){if(e instanceof yi){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===`${Oe}datatype`&&o.object.equals(r))return s}}else{const r=t.store.getObjects(e,qt,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===`${Oe}node`){for(const a of r)if(t.store.getQuads(o.object,Is,a,null).length>0)return s}if(o.predicate.equals(Bc)){for(const a of r)if(o.object.equals(a))return s}}else if(o.predicate.equals(lg)&&o.object.equals(ag))return s}}return console.error("couldn't resolve sh:or/sh:xone on property for value",e),[]}function fg(i,e,t){for(const r of i){let n=!1;const s=t.store.getObjects(r,Eo,null);for(const o of s){const a=t.store.getObjects(o,`${Oe}path`,null);for(const c of a)if(n=t.store.countQuads(e,c,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 pg={[`${Oe}name`]:(i,e)=>{const t=e;i.name=gu(i.config.languages,i.name,t)},[`${Oe}description`]:(i,e)=>{const t=e;i.description=gu(i.config.languages,i.description,t)},[`${Oe}path`]:(i,e)=>{i.path=e.value},[`${Oe}node`]:(i,e)=>{i.node=e},[`${Oe}datatype`]:(i,e)=>{i.datatype=e},[`${Oe}nodeKind`]:(i,e)=>{i.nodeKind=e},[`${Oe}minCount`]:(i,e)=>{i.minCount=parseInt(e.value)},[`${Oe}maxCount`]:(i,e)=>{i.maxCount=parseInt(e.value)},[`${Oe}minLength`]:(i,e)=>{i.minLength=parseInt(e.value)},[`${Oe}maxLength`]:(i,e)=>{i.maxLength=parseInt(e.value)},[`${Oe}minInclusive`]:(i,e)=>{i.minInclusive=parseInt(e.value)},[`${Oe}maxInclusive`]:(i,e)=>{i.maxInclusive=parseInt(e.value)},[`${Oe}minExclusive`]:(i,e)=>{i.minExclusive=parseInt(e.value)},[`${Oe}maxExclusive`]:(i,e)=>{i.maxExclusive=parseInt(e.value)},[`${Oe}pattern`]:(i,e)=>{i.pattern=e.value},[`${Oe}order`]:(i,e)=>{i.order=parseInt(e.value)},[`${pu}singleLine`]:(i,e)=>{i.singleLine=e.value==="true"},[`${pu}readonly`]:(i,e)=>{i.readonly=e.value==="true"},[`${ig}styleClass`]:(i,e)=>{i.cssClass=e.value},[`${Oe}and`]:(i,e)=>{i.shaclAnd=e.value},[`${Oe}in`]:(i,e)=>{i.shaclIn=e.value},[`${Oe}languageIn`]:(i,e)=>{i.languageIn=i.config.lists[e.value],i.datatype=He.namedNode(Pc+"langString")},[`${Oe}defaultValue`]:(i,e)=>{i.defaultValue=e},[`${Oe}hasValue`]:(i,e)=>{i.hasValue=e},[`${Oe}qualifiedValueShape`]:(i,e)=>{i.qualifiedValueShape=e},[`${Oe}qualifiedMinCount`]:(i,e)=>{i.minCount=parseInt(e.value)},[`${Oe}qualifiedMaxCount`]:(i,e)=>{i.maxCount=parseInt(e.value)},[jc.id]:(i,e)=>{i.owlImports.push(e)},[Bc.id]:(i,e)=>{i.class=e;const t=i.config.store.getSubjects(Is,e,null);t.length>0&&(i.node=t[0])},[`${Oe}or`]:(i,e)=>{const t=i.config.lists[e.value];t?.length?i.shaclOr=t:console.error("list for sh:or not found:",e.value,"existing lists:",i.config.lists)},[`${Oe}xone`]:(i,e)=>{const t=i.config.lists[e.value];t?.length?i.shaclXone=t:console.error("list for sh:xone not found:",e.value,"existing lists:",i.config.lists)}};class mg{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){for(const t of e)pg[t.predicate.id]?.call(this,this,t.object);if(this.label=this.name?.value||js(e,this.config.languages),!this.label&&!this.shaclAnd&&(this.label=this.path?Zl(this.path,this.config.prefixes):"unknown"),(this.node||this.shaclAnd)&&(this.node&&this.extendedShapes.push(this.node),this.shaclAnd)){const t=this.config.lists[this.shaclAnd];if(t?.length)for(const r of t)this.extendedShapes.push(r)}return this}clone(){const e=Object.assign({},this);return e.extendedShapes=[...this.extendedShapes],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 gg=`form { display:block; --label-width: 8em; --caret-size: 10px; }
28
28
  form.mode-edit { padding-left: 1em; }
29
29
  form, form * { box-sizing: border-box; }
30
30
  shacl-node, .collapsible::part(content) { display: flex; flex-direction: column; width: 100%; position: relative; }
@@ -72,26 +72,26 @@ a, a:visited { color: inherit; }
72
72
  .collapsible > .property-instance > shacl-node > h1 { display: none; }
73
73
  .ref-link { cursor: pointer; }
74
74
  .ref-link:hover { text-decoration: underline; }
75
- .node-id-display { color: #999; font-size: 11px; }`;class Bm{constructor(e){let t=jm;e&&(t+=`
76
- `+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 so){const c=r.config.store.getQuads(o,null,null,null);if(c.length){const d=Er(c,r.config.languages);d&&(o=d)}}else t instanceof ai&&(t.language?(a=document.createElement("span"),a.classList.add("lang"),a.innerText=`@${t.language}`):t.datatype.value===`${tr}date`?o=new Date(Date.parse(t.value)).toDateString():t.datatype.value===`${tr}dateTime`&&(o=new Date(Date.parse(t.value)).toLocaleString()));let l;return Il(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 Fm(i,e,t){if(t){const r=i.minCount!==void 0&&i.minCount>0;if(i.class)return i.config.theme.createListEditor(i.label,e,r,fc(i.class,i),i);if(i.shaclIn){const n=i.config.lists[i.shaclIn];if(n?.length){const s=_f(n,i.config.store,i.config.languages);return i.config.theme.createListEditor(i.label,e,r,s,i)}else console.error("list not found:",i.shaclIn,"existing lists:",i.config.lists)}if(i.datatype?.value===`${lc}langString`||i.languageIn?.length)return i.config.theme.createLangStringEditor(i.label,e,r,i);switch(i.datatype?.value.replace(tr,"")){case"integer":case"float":case"double":case"decimal":return i.config.theme.createNumberEditor(i.label,e,r,i);case"date":case"dateTime":return i.config.theme.createDateEditor(i.label,e,r,i);case"boolean":return i.config.theme.createBooleanEditor(i.label,e,r,i);case"base64Binary":return i.config.theme.createFileEditor(i.label,e,r,i)}return i.config.theme.createTextEditor(i.label,e,r,i)}else{if(e)return i.config.theme.createViewer(i.label,e,i);const r=document.createElement("div");return r.innerHTML="No value",r}}function qm(i,e,t){if(e==="application/ld+json")return Um(i);{const r=new nc({format:e,prefixes:t});r.addQuads(i);let n="";return r.end((s,o)=>{s&&console.error(s),n=o}),n}}function Um(i){const e=[];for(const t of i){const r={"@id":t.subject.id};if(t.predicate===Tt)r["@type"]=t.object.id;else{let n=t.object.value;t.object instanceof ai?t.object.language?n={"@language":t.object.language,"@value":t.object.value}:t.object.datatype&&t.object.datatype.value!==`${tr}#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 Vm(i){let e=i.shaclDatatype,t=i.value;if(t){if(i.dataset.class||i.dataset.nodeKind===Ae+"IRI")return Fe.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=Fe.namedNode(r[1]))}return Fe.literal(t,e)}else if((i.type==="checkbox"||i.getAttribute("type")==="checkbox")&&(i.checked||parseInt(i.dataset.minCount||"0")>0))return Fe.literal(i.checked?"true":"false",e)}const Hn={};function zm(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 Hm(){return Object.entries(Hn).map(i=>i[1])}function Wm(i,e){let t=Hn[`${i}^${e}`];return t||(t=Hn[`${i}^undefined`],t)?t:Hn[`undefined^${e}`]}class h_{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)}}/**
75
+ .node-id-display { color: #999; font-size: 11px; }`;class bg{constructor(e){let t=gg;e&&(t+=`
76
+ `+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 Mo){const l=r.config.store.getQuads(o,null,null,null);if(l.length){const d=js(l,r.config.languages);d&&(o=d)}}else t instanceof yi&&(t.language?(a=document.createElement("span"),a.classList.add("lang"),a.innerText=`@${t.language}`):t.datatype.value===`${br}date`?o=new Date(Date.parse(t.value)).toDateString():t.datatype.value===`${br}dateTime`&&(o=new Date(Date.parse(t.value)).toLocaleString()));let c;return ec(t.value)?(c=document.createElement("a"),c.setAttribute("href",t.value)):c=document.createElement("div"),c.classList.add("d-flex"),c.innerText=o,a&&c.appendChild(a),n.appendChild(c),n}}function yg(i,e,t){if(t){const r=i.minCount!==void 0&&i.minCount>0;if(i.class)return i.config.theme.createListEditor(i.label,e,r,qc(i.class,i),i);if(i.shaclIn){const n=i.config.lists[i.shaclIn];if(n?.length){const s=rp(n,i.config.store,i.config.languages);return i.config.theme.createListEditor(i.label,e,r,s,i)}else console.error("list not found:",i.shaclIn,"existing lists:",i.config.lists)}if(i.datatype?.value===`${Pc}langString`||i.languageIn?.length)return i.config.theme.createLangStringEditor(i.label,e,r,i);switch(i.datatype?.value.replace(br,"")){case"integer":case"float":case"double":case"decimal":return i.config.theme.createNumberEditor(i.label,e,r,i);case"date":case"dateTime":return i.config.theme.createDateEditor(i.label,e,r,i);case"boolean":return i.config.theme.createBooleanEditor(i.label,e,r,i);case"base64Binary":return i.config.theme.createFileEditor(i.label,e,r,i)}return i.config.theme.createTextEditor(i.label,e,r,i)}else{if(e)return i.config.theme.createViewer(i.label,e,i);const r=document.createElement("div");return r.innerHTML="No value",r}}function vg(i,e,t){if(e==="application/ld+json")return wg(i);{const r=new Nc({format:e,prefixes:t});r.addQuads(i);let n="";return r.end((s,o)=>{s&&console.error(s),n=o}),n}}function wg(i){const e=[];for(const t of i){const r={"@id":t.subject.id};if(t.predicate===qt)r["@type"]=t.object.id;else{let n=t.object.value;t.object instanceof yi?t.object.language?n={"@language":t.object.language,"@value":t.object.value}:t.object.datatype&&t.object.datatype.value!==`${br}#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 _g(i){let e=i.shaclDatatype,t=i.value;if(t){if(i.dataset.class||i.dataset.nodeKind===Oe+"IRI")return He.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=He.namedNode(r[1]))}return He.literal(t,e)}else if((i.type==="checkbox"||i.getAttribute("type")==="checkbox")&&(i.checked||parseInt(i.dataset.minCount||"0")>0))return He.literal(i.checked?"true":"false",e)}const bs={};function xg(i){i.predicate===void 0&&i.datatype===void 0?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',i):bs[`${i.predicate}^${i.datatype}`]=i}function Eg(){return Object.entries(bs).map(i=>i[1])}function Sg(i,e){let t=bs[`${i}^${e}`];return t||(t=bs[`${i}^undefined`],t)?t:bs[`undefined^${e}`]}class ix{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)}}/**
77
77
  * @license
78
78
  * Copyright 2019 Google LLC
79
79
  * SPDX-License-Identifier: BSD-3-Clause
80
- */const Os=globalThis,pc=Os.ShadowRoot&&(Os.ShadyCSS===void 0||Os.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,mc=Symbol(),Jd=new WeakMap;let Sf=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==mc)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(pc&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=Jd.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Jd.set(t,e))}return e}toString(){return this.cssText}};const Gm=i=>new Sf(typeof i=="string"?i:i+"",void 0,mc),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 Sf(t,i,mc)},Km=(i,e)=>{if(pc)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),n=Os.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},Qd=pc?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return Gm(t)})(i):i;/**
80
+ */const fo=globalThis,Uc=fo.ShadowRoot&&(fo.ShadyCSS===void 0||fo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Vc=Symbol(),bu=new WeakMap;let op=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(Uc&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=bu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&bu.set(t,e))}return e}toString(){return this.cssText}};const kg=i=>new op(typeof i=="string"?i:i+"",void 0,Vc),$e=(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 op(t,i,Vc)},Rg=(i,e)=>{if(Uc)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),n=fo.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},yu=Uc?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return kg(t)})(i):i;/**
81
81
  * @license
82
82
  * Copyright 2017 Google LLC
83
83
  * SPDX-License-Identifier: BSD-3-Clause
84
- */const{is:Jm,defineProperty:Qm,getOwnPropertyDescriptor:Xm,getOwnPropertyNames:Ym,getOwnPropertySymbols:Zm,getPrototypeOf:eg}=Object,ho=globalThis,Xd=ho.trustedTypes,tg=Xd?Xd.emptyScript:"",ig=ho.reactiveElementPolyfillSupport,Wn=(i,e)=>i,zr={toAttribute(i,e){switch(e){case Boolean:i=i?tg: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}},gc=(i,e)=>!Jm(i,e),Yd={attribute:!0,type:String,converter:zr,reflect:!1,useDefault:!1,hasChanged:gc};Symbol.metadata??=Symbol("metadata"),ho.litPropertyMetadata??=new WeakMap;let Or=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Yd){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}=Xm(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:n,set(o){const a=n?.call(this);s?.call(this,o),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Yd}static _$Ei(){if(this.hasOwnProperty(Wn("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(Wn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Wn("properties"))){const t=this.properties,r=[...Ym(t),...Zm(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(Qd(n))}else e!==void 0&&t.push(Qd(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(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.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 Km(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){const r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){const s=(r.converter?.toAttribute!==void 0?r.converter:zr).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){const r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){const s=r.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:zr;this._$Em=n;const a=o.fromAttribute(t,s.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){const n=this.constructor,s=this[e];if(r??=n.getPropertyOptions(e),!((r.hasChanged??gc)(s,t)||r.useDefault&&r.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(n._$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??=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??=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(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,s]of r){const{wrapped:o}=s,a=this[n];o!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,s,a)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),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.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};Or.elementStyles=[],Or.shadowRootOptions={mode:"open"},Or[Wn("elementProperties")]=new Map,Or[Wn("finalized")]=new Map,ig?.({ReactiveElement:Or}),(ho.reactiveElementVersions??=[]).push("2.1.1");/**
84
+ */const{is:Ig,defineProperty:Tg,getOwnPropertyDescriptor:Cg,getOwnPropertyNames:$g,getOwnPropertySymbols:Ag,getPrototypeOf:Ng}=Object,Vo=globalThis,vu=Vo.trustedTypes,Dg=vu?vu.emptyScript:"",Lg=Vo.reactiveElementPolyfillSupport,ys=(i,e)=>i,pn={toAttribute(i,e){switch(e){case Boolean:i=i?Dg: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}},zc=(i,e)=>!Ig(i,e),wu={attribute:!0,type:String,converter:pn,reflect:!1,useDefault:!1,hasChanged:zc};Symbol.metadata??=Symbol("metadata"),Vo.litPropertyMetadata??=new WeakMap;let sn=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=wu){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&&Tg(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:s}=Cg(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:n,set(o){const a=n?.call(this);s?.call(this,o),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??wu}static _$Ei(){if(this.hasOwnProperty(ys("elementProperties")))return;const e=Ng(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ys("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ys("properties"))){const t=this.properties,r=[...$g(t),...Ag(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(yu(n))}else e!==void 0&&t.push(yu(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(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.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 Rg(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){const r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){const s=(r.converter?.toAttribute!==void 0?r.converter:pn).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){const r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){const s=r.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:pn;this._$Em=n;const a=o.fromAttribute(t,s.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){const n=this.constructor,s=this[e];if(r??=n.getPropertyOptions(e),!((r.hasChanged??zc)(s,t)||r.useDefault&&r.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(n._$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??=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??=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(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,s]of r){const{wrapped:o}=s,a=this[n];o!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,s,a)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),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.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};sn.elementStyles=[],sn.shadowRootOptions={mode:"open"},sn[ys("elementProperties")]=new Map,sn[ys("finalized")]=new Map,Lg?.({ReactiveElement:sn}),(Vo.reactiveElementVersions??=[]).push("2.1.1");/**
85
85
  * @license
86
86
  * Copyright 2017 Google LLC
87
87
  * SPDX-License-Identifier: BSD-3-Clause
88
- */const yc=globalThis,Ws=yc.trustedTypes,Zd=Ws?Ws.createPolicy("lit-html",{createHTML:i=>i}):void 0,kf="$lit$",Yi=`lit$${Math.random().toFixed(9).slice(2)}$`,If="?"+Yi,rg=`<${If}>`,Sr=document,is=()=>Sr.createComment(""),rs=i=>i===null||typeof i!="object"&&typeof i!="function",bc=Array.isArray,ng=i=>bc(i)||typeof i?.[Symbol.iterator]=="function",sa=`[
89
- \f\r]`,_n=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,eu=/-->/g,tu=/>/g,pr=RegExp(`>|${sa}(?:([^\\s"'>=/]+)(${sa}*=${sa}*(?:[^
90
- \f\r"'\`<>=]|("|')|))|$)`,"g"),iu=/'/g,ru=/"/g,Rf=/^(?:script|style|textarea|title)$/i,sg=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Q=sg(1),At=Symbol.for("lit-noChange"),Ge=Symbol.for("lit-nothing"),nu=new WeakMap,vr=Sr.createTreeWalker(Sr,129);function Tf(i,e){if(!bc(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Zd!==void 0?Zd.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=eu:d[1]!==void 0?o=tu:d[2]!==void 0?(Rf.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]==='"'?ru:iu):o===ru||o===iu?o=pr:o===eu||o===tu?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)+kf+l.slice(f)+Yi+y):l+Yi+(f===-2?a:y)}return[Tf(i,s+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};let Rl=class $f{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=$f.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(kf)){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:fo}),n.removeAttribute(f)}else f.startsWith(Yi)&&(l.push({type:6,index:s}),n.removeAttribute(f));if(Rf.test(n.tagName)){const f=n.textContent.split(Yi),g=f.length-1;if(g>0){n.textContent=Ws?Ws.emptyScript:"";for(let y=0;y<g;y++)n.append(f[y],is()),vr.nextNode(),l.push({type:2,index:++s});n.append(f[g],is())}}}else if(n.nodeType===8)if(n.data===If)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=Sr.createElement("template");return r.innerHTML=e,r}};function Hr(i,e,t=i,r){if(e===At)return e;let n=r!==void 0?t._$Co?.[r]:t._$Cl;const s=rs(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??=[])[r]=n:t._$Cl=n),n!==void 0&&(e=Hr(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?.creationScope??Sr).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 vc(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?.index&&(s=vr.nextNode(),o++)}return vr.currentNode=Sr,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++}},vc=class Cf{get _$AU(){return this._$AM?._$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?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Hr(this,e,t),rs(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&&rs(this._$AH)?this._$AA.nextSibling.data=e:this.T(Sr.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Rl.createElement(Tf(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{const s=new ag(n,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=nu.get(e.strings);return t===void 0&&nu.set(e.strings,t=new Rl(e)),t}k(e){bc(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 Cf(this.O(is()),this.O(is()),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){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},fo=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=Hr(this,e,t,0),o=!rs(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=Hr(this,a[r+l],t,l),c===At&&(c=this._$AH[l]),o||=!rs(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 fo{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ge?void 0:e}},cg=class extends fo{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Ge)}},dg=class extends fo{constructor(e,t,r,n,s){super(e,t,r,n,s),this.type=5}_$AI(e,t=this){if((e=Hr(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){typeof this._$AH=="function"?this._$AH.call(this.options?.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){Hr(this,e)}};const hg=yc.litHtmlPolyfillSupport;hg?.(Rl,vc),(yc.litHtmlVersions??=[]).push("3.3.1");const fg=(i,e,t)=>{const r=t?.renderBefore??e;let n=r._$litPart$;if(n===void 0){const s=t?.renderBefore??null;r._$litPart$=n=new vc(e.insertBefore(is(),s),s,void 0,t??{})}return n._$AI(i),n};/**
88
+ */const Hc=globalThis,So=Hc.trustedTypes,_u=So?So.createPolicy("lit-html",{createHTML:i=>i}):void 0,ap="$lit$",pr=`lit$${Math.random().toFixed(9).slice(2)}$`,lp="?"+pr,Og=`<${lp}>`,Ur=document,Ts=()=>Ur.createComment(""),Cs=i=>i===null||typeof i!="object"&&typeof i!="function",Wc=Array.isArray,Pg=i=>Wc(i)||typeof i?.[Symbol.iterator]=="function",Aa=`[
89
+ \f\r]`,Gn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xu=/-->/g,Eu=/>/g,Tr=RegExp(`>|${Aa}(?:([^\\s"'>=/]+)(${Aa}*=${Aa}*(?:[^
90
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Su=/'/g,ku=/"/g,cp=/^(?:script|style|textarea|title)$/i,Mg=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Z=Mg(1),Vt=Symbol.for("lit-noChange"),it=Symbol.for("lit-nothing"),Ru=new WeakMap,Fr=Ur.createTreeWalker(Ur,129);function dp(i,e){if(!Wc(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return _u!==void 0?_u.createHTML(e):e}const Fg=(i,e)=>{const t=i.length-1,r=[];let n,s=e===2?"<svg>":e===3?"<math>":"",o=Gn;for(let a=0;a<t;a++){const c=i[a];let l,d,u=-1,p=0;for(;p<c.length&&(o.lastIndex=p,d=o.exec(c),d!==null);)p=o.lastIndex,o===Gn?d[1]==="!--"?o=xu:d[1]!==void 0?o=Eu:d[2]!==void 0?(cp.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Tr):d[3]!==void 0&&(o=Tr):o===Tr?d[0]===">"?(o=n??Gn,u=-1):d[1]===void 0?u=-2:(u=o.lastIndex-d[2].length,l=d[1],o=d[3]===void 0?Tr:d[3]==='"'?ku:Su):o===ku||o===Su?o=Tr:o===xu||o===Eu?o=Gn:(o=Tr,n=void 0);const g=o===Tr&&i[a+1].startsWith("/>")?" ":"";s+=o===Gn?c+Og:u>=0?(r.push(l),c.slice(0,u)+ap+c.slice(u)+pr+g):c+pr+(u===-2?a:g)}return[dp(i,s+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};let tc=class up{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let s=0,o=0;const a=e.length-1,c=this.parts,[l,d]=Fg(e,t);if(this.el=up.createElement(l,r),Fr.currentNode=this.el.content,t===2||t===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(n=Fr.nextNode())!==null&&c.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(const u of n.getAttributeNames())if(u.endsWith(ap)){const p=d[o++],g=n.getAttribute(u).split(pr),v=/([.?@])?(.*)/.exec(p);c.push({type:1,index:s,name:v[2],strings:g,ctor:v[1]==="."?Bg:v[1]==="?"?qg:v[1]==="@"?Ug:zo}),n.removeAttribute(u)}else u.startsWith(pr)&&(c.push({type:6,index:s}),n.removeAttribute(u));if(cp.test(n.tagName)){const u=n.textContent.split(pr),p=u.length-1;if(p>0){n.textContent=So?So.emptyScript:"";for(let g=0;g<p;g++)n.append(u[g],Ts()),Fr.nextNode(),c.push({type:2,index:++s});n.append(u[p],Ts())}}}else if(n.nodeType===8)if(n.data===lp)c.push({type:2,index:s});else{let u=-1;for(;(u=n.data.indexOf(pr,u+1))!==-1;)c.push({type:7,index:s}),u+=pr.length-1}s++}}static createElement(e,t){const r=Ur.createElement("template");return r.innerHTML=e,r}};function mn(i,e,t=i,r){if(e===Vt)return e;let n=r!==void 0?t._$Co?.[r]:t._$Cl;const s=Cs(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??=[])[r]=n:t._$Cl=n),n!==void 0&&(e=mn(i,n._$AS(i,e.values),n,r)),e}let jg=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?.creationScope??Ur).importNode(t,!0);Fr.currentNode=n;let s=Fr.nextNode(),o=0,a=0,c=r[0];for(;c!==void 0;){if(o===c.index){let l;c.type===2?l=new Gc(s,s.nextSibling,this,e):c.type===1?l=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(l=new Vg(s,this,e)),this._$AV.push(l),c=r[++a]}o!==c?.index&&(s=Fr.nextNode(),o++)}return Fr.currentNode=Ur,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++}},Gc=class hp{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=it,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=mn(this,e,t),Cs(e)?e===it||e==null||e===""?(this._$AH!==it&&this._$AR(),this._$AH=it):e!==this._$AH&&e!==Vt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Pg(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!==it&&Cs(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ur.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=tc.createElement(dp(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{const s=new jg(n,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=Ru.get(e.strings);return t===void 0&&Ru.set(e.strings,t=new tc(e)),t}k(e){Wc(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 hp(this.O(Ts()),this.O(Ts()),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){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},zo=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,s){this.type=1,this._$AH=it,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=it}_$AI(e,t=this,r,n){const s=this.strings;let o=!1;if(s===void 0)e=mn(this,e,t,0),o=!Cs(e)||e!==this._$AH&&e!==Vt,o&&(this._$AH=e);else{const a=e;let c,l;for(e=s[0],c=0;c<s.length-1;c++)l=mn(this,a[r+c],t,c),l===Vt&&(l=this._$AH[c]),o||=!Cs(l)||l!==this._$AH[c],l===it?e=it:e!==it&&(e+=(l??"")+s[c+1]),this._$AH[c]=l}o&&!n&&this.j(e)}j(e){e===it?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Bg=class extends zo{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===it?void 0:e}},qg=class extends zo{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==it)}},Ug=class extends zo{constructor(e,t,r,n,s){super(e,t,r,n,s),this.type=5}_$AI(e,t=this){if((e=mn(this,e,t,0)??it)===Vt)return;const r=this._$AH,n=e===it&&r!==it||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==it&&(r===it||n);n&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Vg=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){mn(this,e)}};const zg=Hc.litHtmlPolyfillSupport;zg?.(tc,Gc),(Hc.litHtmlVersions??=[]).push("3.3.1");const Hg=(i,e,t)=>{const r=t?.renderBefore??e;let n=r._$litPart$;if(n===void 0){const s=t?.renderBefore??null;r._$litPart$=n=new Gc(e.insertBefore(Ts(),s),s,void 0,t??{})}return n._$AI(i),n};/**
91
91
  * @license
92
92
  * Copyright 2017 Google LLC
93
93
  * SPDX-License-Identifier: BSD-3-Clause
94
- */const wc=globalThis;let ct=class extends Or{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=fg(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return At}};ct._$litElement$=!0,ct.finalized=!0,wc.litElementHydrateSupport?.({LitElement:ct});const pg=wc.litElementPolyfillSupport;pg?.({LitElement:ct});(wc.litElementVersions??=[]).push("4.2.1");var Af=i=>{throw TypeError(i)},Nf=(i,e,t)=>e.has(i)||Af("Cannot "+t),Ji=(i,e,t)=>(Nf(i,e,"read from private field"),t?t.call(i):e.get(i)),mg=(i,e,t)=>e.has(i)?Af("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),gg=(i,e,t,r)=>(Nf(i,e,"write to private field"),e.set(i,t),t);const Cr=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)},Ms=globalThis,_c=Ms.ShadowRoot&&(Ms.ShadyCSS===void 0||Ms.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Lf=Symbol(),su=new WeakMap;let yg=class{constructor(i,e,t){if(this._$cssResult$=!0,t!==Lf)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(_c&&i===void 0){const t=e!==void 0&&e.length===1;t&&(i=su.get(e)),i===void 0&&((this.o=i=new CSSStyleSheet).replaceSync(this.cssText),t&&su.set(e,i))}return i}toString(){return this.cssText}};const bg=i=>new yg(typeof i=="string"?i:i+"",void 0,Lf),vg=(i,e)=>{if(_c)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),n=Ms.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},ou=_c?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return bg(t)})(i):i,{is:wg,defineProperty:_g,getOwnPropertyDescriptor:xg,getOwnPropertyNames:Eg,getOwnPropertySymbols:Sg,getPrototypeOf:kg}=Object,Wr=globalThis,au=Wr.trustedTypes,Ig=au?au.emptyScript:"",lu=Wr.reactiveElementPolyfillSupport,Gn=(i,e)=>i,Gs={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}},xc=(i,e)=>!wg(i,e),cu={attribute:!0,type:String,converter:Gs,reflect:!1,useDefault:!1,hasChanged:xc};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Wr.litPropertyMetadata??(Wr.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=cu){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&&_g(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:s}=xg(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:n,set(o){const a=n?.call(this);s?.call(this,o),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??cu}static _$Ei(){if(this.hasOwnProperty(Gn("elementProperties")))return;const e=kg(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Gn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Gn("properties"))){const t=this.properties,r=[...Eg(t),...Sg(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(ou(n))}else e!==void 0&&t.push(ou(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 vg(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 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:Gs).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){var r,n;const s=this.constructor,o=s._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const a=s.getPropertyOptions(o),l=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:Gs;this._$Em=o,this[o]=l.fromAttribute(t,a.type)??((n=this._$Ej)==null?void 0:n.get(o))??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??xc)(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 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){const{wrapped:a}=o,l=this[s];a!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,o,l)}}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._$EM()}catch(n){throw t=!1,this._$EM(),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)}_$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){}}xn.elementStyles=[],xn.shadowRootOptions={mode:"open"},xn[Gn("elementProperties")]=new Map,xn[Gn("finalized")]=new Map,lu?.({ReactiveElement:xn}),(Wr.reactiveElementVersions??(Wr.reactiveElementVersions=[])).push("2.1.0");const Rg={attribute:!0,type:String,converter:Gs,reflect:!1,hasChanged:xc},Tg=(i=Rg,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 je(i){return(e,t)=>typeof t=="object"?Tg(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)}function Ec(i){return je({...i,state:!0,attribute:!1})}const $g=(i,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(i,e,t),t);function Li(i,e){return(t,r,n)=>{const s=o=>{var a;return((a=o.renderRoot)==null?void 0:a.querySelector(i))??null};return $g(t,r,{get(){return s(this)}})}}var Cg=Object.defineProperty,Ar=(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&&Cg(e,t,n),n};const Tl=class extends ct{constructor(){super(...arguments),this.dense=!1}};Tl.shadowRootOptions={...ct.shadowRootOptions,delegatesFocus:!0},Tl.styles=[Ie`
94
+ */const Kc=globalThis;let yt=class extends sn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.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(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Vt}};yt._$litElement$=!0,yt.finalized=!0,Kc.litElementHydrateSupport?.({LitElement:yt});const Wg=Kc.litElementPolyfillSupport;Wg?.({LitElement:yt});(Kc.litElementVersions??=[]).push("4.2.1");var fp=i=>{throw TypeError(i)},pp=(i,e,t)=>e.has(i)||fp("Cannot "+t),ur=(i,e,t)=>(pp(i,e,"read from private field"),t?t.call(i):e.get(i)),Gg=(i,e,t)=>e.has(i)?fp("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Kg=(i,e,t,r)=>(pp(i,e,"write to private field"),e.set(i,t),t);const Kr=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)},po=globalThis,Xc=po.ShadowRoot&&(po.ShadyCSS===void 0||po.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,mp=Symbol(),Iu=new WeakMap;let Xg=class{constructor(i,e,t){if(this._$cssResult$=!0,t!==mp)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(Xc&&i===void 0){const t=e!==void 0&&e.length===1;t&&(i=Iu.get(e)),i===void 0&&((this.o=i=new CSSStyleSheet).replaceSync(this.cssText),t&&Iu.set(e,i))}return i}toString(){return this.cssText}};const Jg=i=>new Xg(typeof i=="string"?i:i+"",void 0,mp),Qg=(i,e)=>{if(Xc)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),n=po.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},Tu=Xc?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return Jg(t)})(i):i,{is:Yg,defineProperty:Zg,getOwnPropertyDescriptor:eb,getOwnPropertyNames:tb,getOwnPropertySymbols:ib,getPrototypeOf:rb}=Object,gn=globalThis,Cu=gn.trustedTypes,nb=Cu?Cu.emptyScript:"",$u=gn.reactiveElementPolyfillSupport,vs=(i,e)=>i,ko={toAttribute(i,e){switch(e){case Boolean:i=i?nb: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}},Jc=(i,e)=>!Yg(i,e),Au={attribute:!0,type:String,converter:ko,reflect:!1,useDefault:!1,hasChanged:Jc};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),gn.litPropertyMetadata??(gn.litPropertyMetadata=new WeakMap);class Kn 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=Au){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&&Zg(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:s}=eb(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:n,set(o){const a=n?.call(this);s?.call(this,o),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Au}static _$Ei(){if(this.hasOwnProperty(vs("elementProperties")))return;const e=rb(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(vs("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(vs("properties"))){const t=this.properties,r=[...tb(t),...ib(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(Tu(n))}else e!==void 0&&t.push(Tu(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 Qg(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 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:ko).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){var r,n;const s=this.constructor,o=s._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const a=s.getPropertyOptions(o),c=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:ko;this._$Em=o,this[o]=c.fromAttribute(t,a.type)??((n=this._$Ej)==null?void 0:n.get(o))??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??Jc)(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 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){const{wrapped:a}=o,c=this[s];a!==!0||this._$AL.has(s)||c===void 0||this.C(s,void 0,o,c)}}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._$EM()}catch(n){throw t=!1,this._$EM(),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)}_$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){}}Kn.elementStyles=[],Kn.shadowRootOptions={mode:"open"},Kn[vs("elementProperties")]=new Map,Kn[vs("finalized")]=new Map,$u?.({ReactiveElement:Kn}),(gn.reactiveElementVersions??(gn.reactiveElementVersions=[])).push("2.1.0");const sb={attribute:!0,type:String,converter:ko,reflect:!1,hasChanged:Jc},ob=(i=sb,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 c=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,c,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 c=this[o];e.call(this,a),this.requestUpdate(o,c,i)}}throw Error("Unsupported decorator location: "+r)};function ze(i){return(e,t)=>typeof t=="object"?ob(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)}function Qc(i){return ze({...i,state:!0,attribute:!1})}const ab=(i,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(i,e,t),t);function Hi(i,e){return(t,r,n)=>{const s=o=>{var a;return((a=o.renderRoot)==null?void 0:a.querySelector(i))??null};return ab(t,r,{get(){return s(this)}})}}var lb=Object.defineProperty,Xr=(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&&lb(e,t,n),n};const ic=class extends yt{constructor(){super(...arguments),this.dense=!1}};ic.shadowRootOptions={...yt.shadowRootOptions,delegatesFocus:!0},ic.styles=[$e`
95
95
  :host {
96
96
  /* color-scheme: light dark; */
97
97
  --rokit-primary-color-inner: var(--rokit-primary-color, #008877);
@@ -114,11 +114,11 @@ a, a:visited { color: inherit; }
114
114
  }
115
115
  }
116
116
  */
117
- `];let Nr=Tl;Ar([je({type:Boolean,reflect:!0})],Nr.prototype,"dense");var gi;const $l=class extends Nr{constructor(){super(),mg(this,gi),this.value="",this.clearable=!1,this.required=!1,gg(this,gi,this.attachInternals())}checkValidity(){return Ji(this,gi).checkValidity()}reportValidity(){const e=Ji(this,gi).reportValidity();return this.classList.toggle("invalid",!e),e}get validity(){return Ji(this,gi).validity}get validationMessage(){return Ji(this,gi).validationMessage}setCustomValidity(e,t){e?Ji(this,gi).setValidity({customError:!0},e,t):Ji(this,gi).setValidity(void 0)}updateValidity(e,t,r){Ji(this,gi).setValidity(e,t,r)}setFormValue(e,t){Ji(this,gi).setFormValue(e,t)}};gi=new WeakMap,$l.formAssociated=!0,$l.styles=[...Nr.styles,Ie`
117
+ `];let Jr=ic;Xr([ze({type:Boolean,reflect:!0})],Jr.prototype,"dense");var Ti;const rc=class extends Jr{constructor(){super(),Gg(this,Ti),this.value="",this.clearable=!1,this.required=!1,Kg(this,Ti,this.attachInternals())}checkValidity(){return ur(this,Ti).checkValidity()}reportValidity(){const e=ur(this,Ti).reportValidity();return this.classList.toggle("invalid",!e),e}get validity(){return ur(this,Ti).validity}get validationMessage(){return ur(this,Ti).validationMessage}setCustomValidity(e,t){e?ur(this,Ti).setValidity({customError:!0},e,t):ur(this,Ti).setValidity(void 0)}updateValidity(e,t,r){ur(this,Ti).setValidity(e,t,r)}setFormValue(e,t){ur(this,Ti).setFormValue(e,t)}};Ti=new WeakMap,rc.formAssociated=!0,rc.styles=[...Jr.styles,$e`
118
118
  :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; }
119
119
  :host(:focus) { border-color: var(--rokit-primary-color-inner); }
120
120
  :host(.invalid) { border-color: var(--rokit-error-color-inner); }
121
- `];let Di=$l;Ar([je()],Di.prototype,"name");Ar([je()],Di.prototype,"value");Ar([je({type:Boolean})],Di.prototype,"clearable");Ar([je({type:Boolean})],Di.prototype,"required");Ar([je()],Di.prototype,"label");Ar([je()],Di.prototype,"placeholder");function Ag(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 Ng=Object.defineProperty,Lg=Object.getOwnPropertyDescriptor,Df=(i,e,t,r)=>{for(var n=r>1?void 0:r?Lg(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&&Ng(e,t,n),n};let Gr=class extends Nr{constructor(){super(...arguments),this.icon=!1}render(){return Q`<a part="link"><slot><slot></a>`}};Gr.styles=[...Nr.styles,Ie`
121
+ `];let Wi=rc;Xr([ze()],Wi.prototype,"name");Xr([ze()],Wi.prototype,"value");Xr([ze({type:Boolean})],Wi.prototype,"clearable");Xr([ze({type:Boolean})],Wi.prototype,"required");Xr([ze()],Wi.prototype,"label");Xr([ze()],Wi.prototype,"placeholder");function cb(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 db=Object.defineProperty,ub=Object.getOwnPropertyDescriptor,gp=(i,e,t,r)=>{for(var n=r>1?void 0:r?ub(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&&db(e,t,n),n};let bn=class extends Jr{constructor(){super(...arguments),this.icon=!1}render(){return Z`<a part="link"><slot><slot></a>`}};bn.styles=[...Jr.styles,$e`
122
122
  :host { display: inline-flex; }
123
123
  :host a { display: flex; min-width: 1em; height: 1em; padding: 0.5em; cursor: pointer; border-radius: 0.6em; align-items: center; justify-content: center; }
124
124
  :host a:hover { text-shadow: 0 0 1px; }
@@ -130,7 +130,7 @@ a, a:visited { color: inherit; }
130
130
  :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)); }
131
131
  :host(.caret.down) a:before { transform: translate(0.15em, 0.15em) rotate(225deg); }
132
132
  :host(.caret.right) a:before { transform: translate(0em, 0em) rotate(-45deg); }
133
- `];Df([je({type:Boolean,reflect:!0})],Gr.prototype,"icon",2);Gr=Df([Cr("rokit-button")],Gr);var Dg=Object.defineProperty,Og=Object.getOwnPropertyDescriptor,Lr=(i,e,t,r)=>{for(var n=r>1?void 0:r?Og(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&&Dg(e,t,n),n};let Yt=class extends Nr{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=Ag(getComputedStyle(this).getPropertyValue("--rokit-transition-duration-inner"))}updated(i){i.has("transitioning")&&this.classList.toggle("transitioning",this.transitioning),i.has("open")&&(this.transitioning||this.toggle(this.open))}updateContentHeight(){setTimeout(()=>{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")})}onSlotChange(){const i=this.shadowRoot.querySelector("#content > slot").assignedNodes(),e=new MutationObserver(()=>this.updateContentHeight());for(const t of i)e.observe(t,{subtree:!0,childList:!0,characterData:!0});this.updateContentHeight()}toggle(i=!this.open){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 Q`
133
+ `];gp([ze({type:Boolean,reflect:!0})],bn.prototype,"icon",2);bn=gp([Kr("rokit-button")],bn);var hb=Object.defineProperty,fb=Object.getOwnPropertyDescriptor,Qr=(i,e,t,r)=>{for(var n=r>1?void 0:r?fb(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&&hb(e,t,n),n};let di=class extends Jr{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,!0)}),this.transitionDuration=cb(getComputedStyle(this).getPropertyValue("--rokit-transition-duration-inner"))}updated(i){i.has("transitioning")&&this.classList.toggle("transitioning",this.transitioning),i.has("open")&&(this.transitioning||this.toggle(this.open))}updateContentHeight(){setTimeout(()=>{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")})}onSlotChange(){const i=this.shadowRoot.querySelector("#content > slot").assignedNodes(),e=new MutationObserver(()=>this.updateContentHeight());for(const t of i)e.observe(t,{subtree:!0,childList:!0,characterData:!0});this.updateContentHeight()}toggle(i=!this.open,e=!1){this.transitioning=!0,this.open=i,this.toggleButton.classList.toggle("down",i),setTimeout(()=>{this.transitioning=!1,this.open&&e&&this.content.scrollIntoView({block:"nearest"})},this.transitionDuration)}render(){return Z`
134
134
  <header part="header">
135
135
  <slot name="prefix" part="prefix"></slot>
136
136
  <span class="label"><slot name="label" part="label">${this.label}</slot></span>
@@ -141,7 +141,7 @@ a, a:visited { color: inherit; }
141
141
  <div id="content" part="content">
142
142
  <slot @slotchange=${this.onSlotChange}></slot>
143
143
  </div>
144
- `}};Yt.styles=[...Nr.styles,Ie`
144
+ `}};di.styles=[...Jr.styles,$e`
145
145
  :host { display: flex; flex-direction: column; align-items: stretch; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); }
146
146
  :host header { cursor: pointer; }
147
147
  :host([dense]) header { padding: 2px 4px; }
@@ -153,17 +153,17 @@ a, a:visited { color: inherit; }
153
153
  .label { flex-grow: 1; }
154
154
  #content { display: flex; transition: max-height var(--rokit-transition-duration-inner) ease-in-out; position: relative; scrollbar-width: thin; }
155
155
  #toggle { margin-left: 3px; }
156
- `];Lr([je({type:Boolean,reflect:!0})],Yt.prototype,"open",2);Lr([je()],Yt.prototype,"label",2);Lr([je({reflect:!0})],Yt.prototype,"maxHeight",2);Lr([Li("#content")],Yt.prototype,"content",2);Lr([Li("#toggle")],Yt.prototype,"toggleButton",2);Lr([Ec()],Yt.prototype,"transitioning",2);Yt=Lr([Cr("rokit-collapsible")],Yt);var Mg=Object.defineProperty,Pg=Object.getOwnPropertyDescriptor,Of=i=>{throw TypeError(i)},ii=(i,e,t,r)=>{for(var n=r>1?void 0:r?Pg(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&&Mg(e,t,n),n},Mf=(i,e,t)=>e.has(i)||Of("Cannot "+t),jg=(i,e,t)=>(Mf(i,e,"read from private field"),e.get(i)),Bg=(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),du=(i,e,t,r)=>(Mf(i,e,"write to private field"),e.set(i,t),t),Fn;let ft=class extends Di{constructor(){super(),this.type="text",this.disabled=!1,this.readonly=!1,this.sticky=!1,this.minWidth=80,Bg(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(){du(this,Fn,this.value),this.inputElement.addEventListener("change",()=>{this.value=this.inputElement.value}),this.updateMinWidth()}updateMinWidth(){var i,e;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!==jg(this,Fn)&&(du(this,Fn,this.value),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))))}clear(){this.inputElement.value="",this.value="",this.blur()}renderInput(){return Q`<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 Q`
156
+ `];Qr([ze({type:Boolean,reflect:!0})],di.prototype,"open",2);Qr([ze()],di.prototype,"label",2);Qr([ze({reflect:!0})],di.prototype,"maxHeight",2);Qr([Hi("#content")],di.prototype,"content",2);Qr([Hi("#toggle")],di.prototype,"toggleButton",2);Qr([Qc()],di.prototype,"transitioning",2);di=Qr([Kr("rokit-collapsible")],di);var pb=Object.defineProperty,mb=Object.getOwnPropertyDescriptor,bp=i=>{throw TypeError(i)},pi=(i,e,t,r)=>{for(var n=r>1?void 0:r?mb(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&&pb(e,t,n),n},yp=(i,e,t)=>e.has(i)||bp("Cannot "+t),gb=(i,e,t)=>(yp(i,e,"read from private field"),e.get(i)),bb=(i,e,t)=>e.has(i)?bp("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Nu=(i,e,t,r)=>(yp(i,e,"write to private field"),e.set(i,t),t),fs;let Et=class extends Wi{constructor(){super(),this.type="text",this.disabled=!1,this.readonly=!1,this.sticky=!1,this.minWidth=80,bb(this,fs,""),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(){Nu(this,fs,this.value),this.inputElement.addEventListener("change",()=>{this.value=this.inputElement.value}),this.updateMinWidth()}updateMinWidth(){var i,e;const t=this.shadowRoot.querySelector(".wrapper");if(t){const r=((e=(i=this.shadowRoot)==null?void 0:i.querySelector("label"))==null?void 0:e.scrollWidth)||0;t.style.minWidth=`${this.minWidth>r?this.minWidth:r}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!==gb(this,fs)&&(Nu(this,fs,this.value),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))))}clear(){this.inputElement.value="",this.value="",this.blur()}renderInput(){return Z`<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 Z`
157
157
  <slot name="prefix" part="prefix"></slot>
158
158
  <div class="wrapper">
159
159
  <label for="input" part="label">${this.label}</label>
160
160
  ${this.renderInput()}
161
- ${this.clearable?Q`
161
+ ${this.clearable?Z`
162
162
  <rokit-button class="clear" icon ?dense="${this.dense}" @mousedown="${i=>{i.preventDefault()}}" @click="${i=>{i.stopPropagation(),this.clear()}}" title="Clear"></rokit-button>
163
- `:Ge}
163
+ `:it}
164
164
  </div>
165
165
  <slot name="suffix" part="suffix"></slot>
166
- `}};Fn=new WeakMap;ft.styles=[...Di.styles,Ie`
166
+ `}};fs=new WeakMap;Et.styles=[...Wi.styles,$e`
167
167
  :host { background-color: var(--rokit-light-background-color-inner); user-select: none; }
168
168
  :host([dense]) { padding: 2px 4px; }
169
169
  :host(.has-focus:not([readonly])) label, :host(.has-value) label, :host([sticky]) label { font-size: 0.75em; top: 0.5em; font-weight: 600; }
@@ -177,7 +177,7 @@ a, a:visited { color: inherit; }
177
177
  :host(.has-label) #input { margin-top: 0.9em; }
178
178
  :host(.has-label:not(.has-focus):not(.has-value):not([sticky])) #input { clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
179
179
  :host(:not(.has-value)) .clear { visibility: hidden; }
180
- `];ii([je()],ft.prototype,"type",2);ii([je({type:Boolean})],ft.prototype,"disabled",2);ii([je({type:Boolean,reflect:!0})],ft.prototype,"readonly",2);ii([je({type:Boolean,reflect:!0})],ft.prototype,"sticky",2);ii([je()],ft.prototype,"pattern",2);ii([je()],ft.prototype,"minLength",2);ii([je()],ft.prototype,"maxLength",2);ii([je()],ft.prototype,"min",2);ii([je()],ft.prototype,"max",2);ii([je()],ft.prototype,"step",2);ii([je()],ft.prototype,"minWidth",2);ii([Li("#input")],ft.prototype,"inputElement",2);ft=ii([Cr("rokit-input")],ft);var Fg=Object.defineProperty,qg=Object.getOwnPropertyDescriptor,Pf=i=>{throw TypeError(i)},jt=(i,e,t,r)=>{for(var n=r>1?void 0:r?qg(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&&Fg(e,t,n),n},jf=(i,e,t)=>e.has(i)||Pf("Cannot "+t),uu=(i,e,t)=>(jf(i,e,"read from private field"),t?t.call(i):e.get(i)),hu=(i,e,t)=>e.has(i)?Pf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),$s=(i,e,t,r)=>(jf(i,e,"write to private field"),e.set(i,t),t),Mr,Ps;let pt=class extends Di{constructor(){super(),this.emptyMessage="Nothing to select",this.collapsibleOrientationLeft="0",this.collapsibleOrientationRight="0",this.collapsibleWidth="",this.collapse=!1,this.filterableThreshold=15,this.itemCount=0,hu(this,Mr,""),hu(this,Ps,""),this.addEventListener("focus",()=>{this.collapsible.toggle(!0)}),this.addEventListener("blur",()=>{this.checkInputValue(),this.collapsible.toggle(!1)})}firstUpdated(){$s(this,Mr,this.value),$s(this,Ps,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(e){var t;if(e.has("selectedItem")){const r=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(),r!==this.value&&this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}e.has("value")&&this.selectItem(this.findItem(this.value)),(e.has("filterableThreshold")||e.has("itemCount"))&&(this.input.readonly=this.filterableThreshold<0||this.itemCount<this.filterableThreshold),(t=this.collapsible)!=null&&t.toggleButton&&(this.collapsible.toggleButton.style.display=this.listContainer.childElementCount===0?"none":"")}checkInputValue(e=!0){if(this.input.value){const t=this.findItem(this.input.value);if(t){this.selectItem(t);return}}e&&(this.input.value="",this.input.title="",$s(this,Mr,""),this.selectItem(null,!1))}filter(e){var t,r,n;e=e.toLowerCase();let s=!0;for(const o of this.listContainer.querySelectorAll("li"))if(o.id!=="noresult"){const a=this.itemText(o).toLowerCase().indexOf(e)==-1;o.classList.toggle("hidden",a),this.collapse&&(o.classList.remove("open"),(t=o.querySelector("ul"))==null||t.classList.remove("open")),a||(s=!1)}for(const o of this.listContainer.querySelectorAll("li:has(li:not(.hidden))"))o.classList.remove("hidden"),e&&this.collapse&&(o.classList.add("open"),(r=o.querySelector("ul"))==null||r.classList.add("open")),s=!1;this.highlightItem(null),(n=this.listContainer.querySelector("#noresult"))==null||n.classList.toggle("hidden",!s)}selectItem(e,t=!0){e?.getAttribute("disabled")!==null&&(e=null),this.selectedItem=e,this.filter(""),this.highlightItem(e,!1),t&&this.value&&$s(this,Mr,this.value),setTimeout(()=>this.blur())}findItem(e){if(e){for(const t of this.listContainer.querySelectorAll("li"))if(this.itemValue(t)===e||this.itemText(t)===e)return t}return null}highlightItem(e,t=!0){var r,n;if((r=this.listContainer.querySelector("li.active"))==null||r.classList.remove("active"),e){if(t&&this.listContainer.focus(),e.classList.add("active"),this.collapse)for(let s=e.closest("ul");s;s=s.parentElement.closest("ul"))s.classList.add("open"),(n=s.closest("li"))==null||n.classList.add("open");e.scrollIntoView({block:"nearest"})}}highlightNextItem(){const e=this.listContainer.querySelector("li.active");let t=e;const r=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");if(e){for(let n=0;n<r.length;n++)if(r[n]===e&&n<r.length-1){t=r[n+1];break}}else r.length>0&&(t=r[0]);this.highlightItem(t)}highlightPreviousItem(){const e=this.listContainer.querySelector("li.active");let t=null;if(e){const r=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");for(let n=0;n<r.length;n++)if(r[n]===e&&n>0){t=r[n-1];break}}this.highlightItem(t),t||this.input.focus()}itemValue(e){return e.dataset.value||this.itemText(e)||""}itemText(e){var t;return((t=e.querySelector("div > div"))==null?void 0:t.innerText)||""}elementText(e){var t;let r="";for(const n of e.childNodes)n.nodeType==3&&(r+=(t=n.nodeValue)==null?void 0:t.trim());return r}onSlotChange(){this.listContainer.replaceChildren(),this.itemCount=0;let e=null;const t=this.shadowRoot.querySelector("#list-container-slot").assignedElements();if(t?.length===1&&(e=Array.prototype.slice.call(t[0].querySelectorAll(":scope > li")),this.copyItems(e,this.listContainer)),this.emptyMessage){const r=document.createElement("li");r.id="noresult",r.setAttribute("disabled",""),r.innerText=this.emptyMessage,this.listContainer.appendChild(r),e&&e.length>0&&r.classList.add("hidden")}this.value=this.value||uu(this,Mr),this.selectItem(this.findItem(this.value))}copyItems(e,t,r=0){if(this.sort!==void 0){const s=this.sort||"asc";e=e.sort((o,a)=>s==="desc"?(this.elementText(a)||this.itemValue(a)).localeCompare(this.elementText(o)||this.itemValue(o)):(this.elementText(o)||this.itemValue(o)).localeCompare(this.elementText(a)||this.itemValue(a)))}let n="";r>0&&(n=`calc(0.3em + ${r}*${uu(this,Ps)})`);for(const s of e){const o=s.cloneNode();o.replaceChildren();const a=document.createElement("div");n&&(a.style.paddingLeft=n);const l=document.createElement("div");a.appendChild(l);for(const d of s.childNodes)if(d.nodeName!=="UL"){const f=d.cloneNode(!0);f.nodeType===3&&f.nodeValue&&(f.nodeValue=f.nodeValue.trim()),l.appendChild(f)}o.appendChild(a),o.title=o.title||this.itemText(o);const c=s.querySelector("ul");if(c!=null&&c.childElementCount){const d=document.createElement("ul");if(o.appendChild(d),this.copyItems(Array.prototype.slice.call(c.children),d,r+1),this.collapse){const f=new Gr;f.title="Open",f.dense=!0,f.icon=!0,f.classList.add("toggle-node","caret"),f.addEventListener("click",g=>{g.stopPropagation(),o.classList.toggle("open"),d.classList.toggle("open"),f.title=o.classList.contains("open")?"Close":"Open",this.collapsible.updateContentHeight()}),a.prepend(f)}else d.classList.add("open")}t.appendChild(o),this.itemCount++}}render(){return Q`
180
+ `];pi([ze()],Et.prototype,"type",2);pi([ze({type:Boolean})],Et.prototype,"disabled",2);pi([ze({type:Boolean,reflect:!0})],Et.prototype,"readonly",2);pi([ze({type:Boolean,reflect:!0})],Et.prototype,"sticky",2);pi([ze()],Et.prototype,"pattern",2);pi([ze()],Et.prototype,"minLength",2);pi([ze()],Et.prototype,"maxLength",2);pi([ze()],Et.prototype,"min",2);pi([ze()],Et.prototype,"max",2);pi([ze()],Et.prototype,"step",2);pi([ze()],Et.prototype,"minWidth",2);pi([Hi("#input")],Et.prototype,"inputElement",2);Et=pi([Kr("rokit-input")],Et);var yb=Object.defineProperty,vb=Object.getOwnPropertyDescriptor,vp=i=>{throw TypeError(i)},Jt=(i,e,t,r)=>{for(var n=r>1?void 0:r?vb(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&&yb(e,t,n),n},wp=(i,e,t)=>e.has(i)||vp("Cannot "+t),Du=(i,e,t)=>(wp(i,e,"read from private field"),t?t.call(i):e.get(i)),Lu=(i,e,t)=>e.has(i)?vp("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),so=(i,e,t,r)=>(wp(i,e,"write to private field"),e.set(i,t),t),on,mo;let St=class extends Wi{constructor(){super(),this.emptyMessage="Nothing to select",this.collapsibleOrientationLeft="0",this.collapsibleOrientationRight="0",this.collapsibleWidth="",this.collapse=!1,this.filterableThreshold=15,this.itemCount=0,Lu(this,on,""),Lu(this,mo,""),this.addEventListener("focus",()=>{this.collapsible.toggle(!0)}),this.addEventListener("blur",()=>{this.checkInputValue(),this.collapsible.toggle(!1)})}firstUpdated(){so(this,on,this.value),so(this,mo,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(e){var t;if(e.has("selectedItem")){const r=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(),r!==this.value&&this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}e.has("value")&&this.selectItem(this.findItem(this.value)),(e.has("filterableThreshold")||e.has("itemCount"))&&(this.input.readonly=this.filterableThreshold<0||this.itemCount<this.filterableThreshold),(t=this.collapsible)!=null&&t.toggleButton&&(this.collapsible.toggleButton.style.display=this.listContainer.childElementCount===0?"none":"")}checkInputValue(e=!0){if(this.input.value){const t=this.findItem(this.input.value);if(t){this.selectItem(t);return}}e&&(this.input.value="",this.input.title="",so(this,on,""),this.selectItem(null,!1))}filter(e){var t,r,n;e=e.toLowerCase();let s=!0;for(const o of this.listContainer.querySelectorAll("li"))if(o.id!=="noresult"){const a=this.itemText(o).toLowerCase().indexOf(e)==-1;o.classList.toggle("hidden",a),this.collapse&&(o.classList.remove("open"),(t=o.querySelector("ul"))==null||t.classList.remove("open")),a||(s=!1)}for(const o of this.listContainer.querySelectorAll("li:has(li:not(.hidden))"))o.classList.remove("hidden"),e&&this.collapse&&(o.classList.add("open"),(r=o.querySelector("ul"))==null||r.classList.add("open")),s=!1;this.highlightItem(null),(n=this.listContainer.querySelector("#noresult"))==null||n.classList.toggle("hidden",!s)}selectItem(e,t=!0){e?.getAttribute("disabled")!==null&&(e=null),this.selectedItem=e,this.filter(""),this.highlightItem(e,!1),t&&this.value&&so(this,on,this.value),setTimeout(()=>this.blur())}findItem(e){if(e){for(const t of this.listContainer.querySelectorAll("li"))if(this.itemValue(t)===e||this.itemText(t)===e)return t}return null}highlightItem(e,t=!0){var r,n;if((r=this.listContainer.querySelector("li.active"))==null||r.classList.remove("active"),e){if(t&&this.listContainer.focus(),e.classList.add("active"),this.collapse)for(let s=e.closest("ul");s;s=s.parentElement.closest("ul"))s.classList.add("open"),(n=s.closest("li"))==null||n.classList.add("open");this.collapsible.open&&e.scrollIntoView({block:"nearest"})}}highlightNextItem(){const e=this.listContainer.querySelector("li.active");let t=e;const r=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");if(e){for(let n=0;n<r.length;n++)if(r[n]===e&&n<r.length-1){t=r[n+1];break}}else r.length>0&&(t=r[0]);this.highlightItem(t)}highlightPreviousItem(){const e=this.listContainer.querySelector("li.active");let t=null;if(e){const r=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");for(let n=0;n<r.length;n++)if(r[n]===e&&n>0){t=r[n-1];break}}this.highlightItem(t),t||this.input.focus()}itemValue(e){return e.dataset.value||this.itemText(e)||""}itemText(e){var t;return((t=e.querySelector("div > div"))==null?void 0:t.innerText)||""}elementText(e){var t;let r="";for(const n of e.childNodes)n.nodeType==3&&(r+=(t=n.nodeValue)==null?void 0:t.trim());return r}onSlotChange(){this.listContainer.replaceChildren(),this.itemCount=0;let e=null;const t=this.shadowRoot.querySelector("#list-container-slot").assignedElements();if(t?.length===1&&(e=Array.prototype.slice.call(t[0].querySelectorAll(":scope > li")),this.copyItems(e,this.listContainer)),this.emptyMessage){const r=document.createElement("li");r.id="noresult",r.setAttribute("disabled",""),r.innerText=this.emptyMessage,this.listContainer.appendChild(r),e&&e.length>0&&r.classList.add("hidden")}this.value=this.value||Du(this,on),this.selectItem(this.findItem(this.value))}copyItems(e,t,r=0){if(this.sort!==void 0){const s=this.sort||"asc";e=e.sort((o,a)=>s==="desc"?(this.elementText(a)||this.itemValue(a)).localeCompare(this.elementText(o)||this.itemValue(o)):(this.elementText(o)||this.itemValue(o)).localeCompare(this.elementText(a)||this.itemValue(a)))}let n="";r>0&&(n=`calc(0.3em + ${r}*${Du(this,mo)})`);for(const s of e){const o=s.cloneNode();o.replaceChildren();const a=document.createElement("div");n&&(a.style.paddingLeft=n);const c=document.createElement("div");a.appendChild(c);for(const d of s.childNodes)if(d.nodeName!=="UL"){const u=d.cloneNode(!0);u.nodeType===3&&u.nodeValue&&(u.nodeValue=u.nodeValue.trim()),c.appendChild(u)}o.appendChild(a),o.title=o.title||this.itemText(o);const l=s.querySelector("ul");if(l!=null&&l.childElementCount){const d=document.createElement("ul");if(o.appendChild(d),this.copyItems(Array.prototype.slice.call(l.children),d,r+1),this.collapse){const u=new bn;u.title="Open",u.dense=!0,u.icon=!0,u.classList.add("toggle-node","caret"),u.addEventListener("click",p=>{p.stopPropagation(),o.classList.toggle("open"),d.classList.toggle("open"),u.title=o.classList.contains("open")?"Close":"Open",this.collapsible.updateContentHeight()}),a.prepend(u)}else d.classList.add("open")}t.appendChild(o),this.itemCount++}}render(){return Z`
181
181
  <rokit-collapsible ?dense="${this.dense}" part="collapsible">
182
182
  <slot name="prefix" part="prefix" slot="prefix"></slot>
183
183
  <slot name="suffix" part="suffix" slot="suffix"></slot>
@@ -196,7 +196,7 @@ a, a:visited { color: inherit; }
196
196
  </ul>
197
197
  <slot id="list-container-slot" @slotchange=${this.onSlotChange}></slot>
198
198
  </rokit-collapsible>
199
- `}};Mr=new WeakMap;Ps=new WeakMap;pt.styles=[...Di.styles,Ie`
199
+ `}};on=new WeakMap;mo=new WeakMap;St.styles=[...Wi.styles,$e`
200
200
  :host { background-color: var(--rokit-light-background-color-inner); user-select: none; padding: 0; }
201
201
  :host([dense]) li > div { padding: 4px 2px; }
202
202
  :host([dense]) li.large > div, :host([dense]) li.header > div { padding-top: 6px; padding-bottom: 6px; }
@@ -222,38 +222,37 @@ a, a:visited { color: inherit; }
222
222
  :host([collapse]) li > div > div { padding-left: 1.8em; }
223
223
  :host([collapse]) ul:not(.open) { display: none; }
224
224
  :host([collapse]) li:not(.open) > div > .toggle-node::part(link):before { transform: translate(0em, 0em) rotate(-45deg); }
225
- `];jt([je()],pt.prototype,"emptyMessage",2);jt([je()],pt.prototype,"sort",2);jt([je()],pt.prototype,"collapsibleMaxHeight",2);jt([je()],pt.prototype,"collapsibleOrientationLeft",2);jt([je()],pt.prototype,"collapsibleOrientationRight",2);jt([je()],pt.prototype,"collapsibleWidth",2);jt([je()],pt.prototype,"inputMinWidth",2);jt([je({type:Boolean,reflect:!0})],pt.prototype,"collapse",2);jt([je()],pt.prototype,"filterableThreshold",2);jt([Li("rokit-collapsible")],pt.prototype,"collapsible",2);jt([Li("#input")],pt.prototype,"input",2);jt([Li("#list-container")],pt.prototype,"listContainer",2);jt([Ec()],pt.prototype,"selectedItem",2);jt([Ec()],pt.prototype,"itemCount",2);pt=jt([Cr("rokit-select")],pt);var Ug=Object.defineProperty,Vg=Object.getOwnPropertyDescriptor,po=(i,e,t,r)=>{for(var n=r>1?void 0:r?Vg(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&&Ug(e,t,n),n};let Kr=class extends ft{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 Q`
225
+ `];Jt([ze()],St.prototype,"emptyMessage",2);Jt([ze()],St.prototype,"sort",2);Jt([ze()],St.prototype,"collapsibleMaxHeight",2);Jt([ze()],St.prototype,"collapsibleOrientationLeft",2);Jt([ze()],St.prototype,"collapsibleOrientationRight",2);Jt([ze()],St.prototype,"collapsibleWidth",2);Jt([ze()],St.prototype,"inputMinWidth",2);Jt([ze({type:Boolean,reflect:!0})],St.prototype,"collapse",2);Jt([ze()],St.prototype,"filterableThreshold",2);Jt([Hi("rokit-collapsible")],St.prototype,"collapsible",2);Jt([Hi("#input")],St.prototype,"input",2);Jt([Hi("#list-container")],St.prototype,"listContainer",2);Jt([Qc()],St.prototype,"selectedItem",2);Jt([Qc()],St.prototype,"itemCount",2);St=Jt([Kr("rokit-select")],St);var wb=Object.defineProperty,_b=Object.getOwnPropertyDescriptor,Ho=(i,e,t,r)=>{for(var n=r>1?void 0:r?_b(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&&wb(e,t,n),n};let yn=class extends Et{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 Z`
226
226
  <textarea id="input" part="input" autocomplete="off" name="${this.name}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.value}"></textarea>
227
227
  <slot id="content" @slotchange=${this.onSlotChange}></slot>
228
- `}};Kr.styles=[...ft.styles,Ie`
229
- :host { align-items: last baseline; }
228
+ `}};yn.styles=[...Et.styles,$e`
229
+ :host, .wrapper { align-items: flex-start; }
230
230
  #input { height: initial; }
231
231
  #content { display: none; }
232
- .wrapper { align-items: flex-start; }
233
- `];po([je()],Kr.prototype,"resize",2);po([je()],Kr.prototype,"rows",2);po([je()],Kr.prototype,"cols",2);Kr=po([Cr("rokit-textarea")],Kr);var zg=Object.defineProperty,Hg=Object.getOwnPropertyDescriptor,Bf=i=>{throw TypeError(i)},Oi=(i,e,t,r)=>{for(var n=r>1?void 0:r?Hg(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&&zg(e,t,n),n},Ff=(i,e,t)=>e.has(i)||Bf("Cannot "+t),We=(i,e,t)=>(Ff(i,e,"read from private field"),t?t.call(i):e.get(i)),oa=(i,e,t)=>e.has(i)?Bf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Cs=(i,e,t,r)=>(Ff(i,e,"write to private field"),e.set(i,t),t),it,Pi,Pr;const Zi=18;let Fi=class extends ft{constructor(){super(...arguments),this.labelFormatter=i=>String(i),oa(this,it,[0,1]),oa(this,Pi,[We(this,it)[0],We(this,it)[1]]),oa(this,Pr)}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")&&Cs(this,Pr,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);Cs(this,Pi,[this.applyConstraints(e[0]),this.applyConstraints(e[1])])}else Cs(this,Pi,[this.applyConstraints(parseFloat(this.value))]);else Cs(this,Pi,[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,Pr)&&(t=Math.round(t/We(this,Pr))*We(this,Pr)),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,Pi)[0]),this.endKnob&&this.updateKnob(this.endKnob,We(this,Pi)[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,Pi)[0],e.value]):this.value=JSON.stringify([e.value,We(this,Pi)[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 Q`
232
+ `];Ho([ze()],yn.prototype,"resize",2);Ho([ze()],yn.prototype,"rows",2);Ho([ze()],yn.prototype,"cols",2);yn=Ho([Kr("rokit-textarea")],yn);var xb=Object.defineProperty,Eb=Object.getOwnPropertyDescriptor,_p=i=>{throw TypeError(i)},Gi=(i,e,t,r)=>{for(var n=r>1?void 0:r?Eb(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&&xb(e,t,n),n},xp=(i,e,t)=>e.has(i)||_p("Cannot "+t),et=(i,e,t)=>(xp(i,e,"read from private field"),t?t.call(i):e.get(i)),Na=(i,e,t)=>e.has(i)?_p("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),oo=(i,e,t,r)=>(xp(i,e,"write to private field"),e.set(i,t),t),ct,Qi,an;const mr=18;let er=class extends Et{constructor(){super(...arguments),this.labelFormatter=i=>String(i),Na(this,ct,[0,1]),Na(this,Qi,[et(this,ct)[0],et(this,ct)[1]]),Na(this,an)}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")&&(et(this,ct)[0]=parseFloat(this.min||"0"),et(this,ct)[1]=Math.max(et(this,ct)[0],et(this,ct)[1])),i.has("max")&&(et(this,ct)[1]=parseFloat(this.max||"1"),et(this,ct)[0]=Math.min(et(this,ct)[0],et(this,ct)[1])),i.has("step")&&oo(this,an,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);oo(this,Qi,[this.applyConstraints(e[0]),this.applyConstraints(e[1])])}else oo(this,Qi,[this.applyConstraints(parseFloat(this.value))]);else oo(this,Qi,[et(this,ct)[0],et(this,ct)[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===et(this,ct)[0]?e=this.endKnob:e.id==="end"&&e.value===et(this,ct)[1]&&(e=this.startKnob)),e}toScreenSpace(i){return(i-et(this,ct)[0])/(et(this,ct)[1]-et(this,ct)[0])*this.track.offsetWidth}toValueSpace(i){return i/this.track.offsetWidth*(et(this,ct)[1]-et(this,ct)[0])+et(this,ct)[0]}applyConstraints(i,e){let t=Math.min(Math.max(i,et(this,ct)[0]),et(this,ct)[1]);return et(this,an)&&(t=Math.round(t/et(this,an))*et(this,an)),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,et(this,Qi)[0]),this.endKnob&&this.updateKnob(this.endKnob,et(this,Qi)[1])}onKnobDrag(i){if(i.target instanceof vn||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([et(this,Qi)[0],e.value]):this.value=JSON.stringify([e.value,et(this,Qi)[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 Z`
234
233
  ${super.renderInput()}
235
234
  <div id="slider" part="slider" tabindex="0" ?range="${this.range!==void 0}">
236
235
  <div id="track"></div>
237
236
  <rokit-slider-knob id="start"></rokit-slider-knob>
238
- ${this.range===void 0?Ge:Q`
237
+ ${this.range===void 0?it:Z`
239
238
  <rokit-slider-knob id="end"></rokit-slider-knob>
240
239
  `}
241
240
  </div>
242
- `}};it=new WeakMap;Pi=new WeakMap;Pr=new WeakMap;Fi.styles=[...ft.styles,Ie`
241
+ `}};ct=new WeakMap;Qi=new WeakMap;an=new WeakMap;er.styles=[...Et.styles,$e`
243
242
  :host(.has-label:not(:focus):not(.has-value):not([sticky])) #slider > * { visibility: hidden; }
244
243
  :host(.has-label) .wrapper { padding-top: 1em; }
245
- :host([sticky]) #slider { margin-top: ${.25*Zi+22}px; }
244
+ :host([sticky]) #slider { margin-top: ${.25*mr+22}px; }
246
245
  #input { display: none; }
247
- #slider { display: flex; position: relative; align-items: center; width: 100%; height: ${Zi}px; padding: 0 ${Zi/2}px; outline: 0; }
246
+ #slider { display: flex; position: relative; align-items: center; width: 100%; height: ${mr}px; padding: 0 ${mr/2}px; outline: 0; }
248
247
  :host(:not([sticky])) #slider:not(:focus) rokit-slider-knob::part(label) { color: transparent; background-color: transparent; border-color: transparent; top: 0; }
249
248
  #track { height: 2px; flex-grow: 1; background-color: #CCC; }
250
249
  #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; }
251
- `];Oi([je()],Fi.prototype,"range",2);Oi([je()],Fi.prototype,"labelFormatter",2);Oi([Li("#slider")],Fi.prototype,"sliderElement",2);Oi([Li("#track")],Fi.prototype,"track",2);Oi([Li("#start")],Fi.prototype,"startKnob",2);Oi([Li("#end")],Fi.prototype,"endKnob",2);Fi=Oi([Cr("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 Q`<label part="label">${this.label}</label>`}};Jr.styles=[Ie`
252
- :host { position: absolute; width: ${Zi}px; height: ${Zi}px; border-radius: ${Zi}px; background-color: var(--rokit-primary-color-inner); }
253
- :host(.focus), :host(:hover) { box-shadow: 0 0 0 ${Zi/2}px var(--rokit-primary-color-transparent-inner); z-index: 1; }
250
+ `];Gi([ze()],er.prototype,"range",2);Gi([ze()],er.prototype,"labelFormatter",2);Gi([Hi("#slider")],er.prototype,"sliderElement",2);Gi([Hi("#track")],er.prototype,"track",2);Gi([Hi("#start")],er.prototype,"startKnob",2);Gi([Hi("#end")],er.prototype,"endKnob",2);er=Gi([Kr("rokit-slider")],er);let vn=class extends yt{constructor(){super(...arguments),this.offset=0,this.label="",this.value=0}updated(i){i.has("offset")&&(this.style.left=this.offset+"px")}render(){return Z`<label part="label">${this.label}</label>`}};vn.styles=[$e`
251
+ :host { position: absolute; width: ${mr}px; height: ${mr}px; border-radius: ${mr}px; background-color: var(--rokit-primary-color-inner); }
252
+ :host(.focus), :host(:hover) { box-shadow: 0 0 0 ${mr/2}px var(--rokit-primary-color-transparent-inner); z-index: 1; }
254
253
  label {
255
254
  position: absolute;
256
- top: calc(-2em - ${Zi/4}px);
255
+ top: calc(-2em - ${mr/4}px);
257
256
  left: 50%;
258
257
  transform: translate(-50%, 0);
259
258
  white-space: nowrap;
@@ -278,34 +277,60 @@ a, a:visited { color: inherit; }
278
277
  background-color: inherit;
279
278
  clip-path: polygon(50% 50%, 100% 50%, 50% 100%, 0 50%);
280
279
  }
281
- `];Oi([je()],Jr.prototype,"offset",2);Oi([je()],Jr.prototype,"label",2);Jr=Oi([Cr("rokit-slider-knob")],Jr);class Ks extends HTMLElement{constructor(e,t,r,n){if(super(),this.template=new Pm(r.store.getQuads(e,null,null,null),t,r),this.template.extendedShapes.length&&this.template.config.attributes.collapse!==null&&(!this.template.maxCount||this.template.maxCount>1)){const s=new Yt;s.classList.add("collapsible","shacl-group"),s.open=r.attributes.collapse==="open",s.label=this.template.label,this.container=s}else this.container=this;if(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.container.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,Ii));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)}r.editMode&&!t.linked&&(this.addEventListener("change",()=>{this.updateControls()}),this.updateControls()),this.container instanceof Yt&&(r.editMode&&!t.linked||this.container.childElementCount>0)&&this.appendChild(this.container)}addPropertyInstance(e){let t;if(this.template.shaclOr?.length||this.template.shaclXone?.length){const r=this.template.shaclOr?.length?this.template.shaclOr:this.template.shaclXone;let n=!1;if(e){const s=Dm(r,e,this.template.config);s.length&&(t=js(this.template.clone().merge(s),e,!0),n=!0)}n||(t=Ef(r,this,this.template.config),qf(t,""))}else{let r=!1;if(e&&!(e instanceof ai)){const n=this.getRdfClassToLinkOrCreate();n&&this.template.config.store.countQuads(e,Tt,n,Ii)===0&&(r=!0)}t=js(this.template,e,void 0,r||this.template.parent.linked)}return this.addButton?this.container.insertBefore(t,this.addButton):this.container.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),r&&this.addButton?.input&&this.addButton.input.updateMinWidth()}toRDF(e,t){for(const r of this.querySelectorAll(":scope > .property-instance, :scope > .collapsible > .property-instance")){const n=Fe.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=Vm(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,ts,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,ts,null);for(const n of r)if(this.template.config.store.countQuads(e,Tt,n,null)>0)return!0}return!1}createAddButton(){const e=new pt;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=fc(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(()=>{Lm(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.container.insertBefore(js(this.template,l,!0,!0),e)}e.value=""})}return e}}function js(i,e,t=!1,r=!1){let n;if(i.extendedShapes.length){n=document.createElement("div"),n.classList.add("property-instance");for(const s of i.extendedShapes)n.appendChild(new ir(s,i.config,e,i.parent,i.nodeKind,i.label,r))}else{const s=Wm(i.path,i.datatype?.value);s?i.config.editMode&&!r?n=s.createEditor(i,e):n=s.createViewer(i,e):n=Fm(i,e||null,i.config.editMode&&!r),n.classList.add("property-instance"),r&&n.classList.add("linked")}return i.config.editMode&&qf(n,i.label,t),n.dataset.path=i.path,n}function qf(i,e,t=!1){const r=new Gr;r.classList.add("remove-button","clear"),r.title="Remove "+e,r.dense=!0,r.icon=!0,r.addEventListener("click",n=>{i.classList.remove("fadeIn"),i.classList.add("fadeOut"),setTimeout(()=>{const s=i.parentElement;i.remove(),s?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),t&&r.classList.add("persistent"),i.appendChild(r)}window.customElements.define("shacl-property",Ks);function Wg(i,e){let t=i;const r=e.store.getQuads(i,null,null,null),n=zn(r,"label",cc,e.languages);n&&(t=n);let s;if(e.attributes.collapse!==null)s=new Yt,s.classList.add("collapsible"),s.open=e.attributes.collapse==="open",s.label=t;else{s=document.createElement("div");const a=document.createElement("h1");a.innerText=t,s.appendChild(a)}s.dataset.subject=i,s.classList.add("shacl-group");const o=zn(r,"order");return o&&(s.style.order=o),s}const wt=[];for(let i=0;i<256;++i)wt.push((i+256).toString(16).slice(1));function Gg(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 aa;const Kg=new Uint8Array(16);function Jg(){if(!aa){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");aa=crypto.getRandomValues.bind(crypto)}return aa(Kg)}const Qg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),fu={randomUUID:Qg};function pu(i,e,t){if(fu.randomUUID&&!i)return fu.randomUUID();i=i||{};const r=i.random??i.rng?.()??Jg();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,Gg(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?.value===`${Ae}IRI`?l=Fe.namedNode(t.attributes.valuesNamespace+pu()):l=Fe.blankNode(pu())}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=()=>{this.config.form.querySelector(`shacl-node[data-node-id='${g}']`)?.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,uc,null,null))this.owlImports.push(d.object);for(const d of t.store.getQuads(e,null,null,null))switch(d.predicate.id){case Hs.id:this.addPropertyInstance(d.object,t,r);break;case`${Ae}and`:const f=t.lists[d.object.value];if(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,Tt,this.targetClass,this.config.valuesGraphId),this.config.attributes.generateNodeShapeReference&&!this.parent&&e.addQuad(t,Fe.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=Wg(a,t),this.appendChild(l)),n=l}else console.warn("ignoring unknown group reference",s[0],"existing groups:",t.groups)}const o=new Ks(e,this,t,r);o.childElementCount>0&&n.appendChild(o)}tryResolve(e,t,r){const n=r.lists[e.value];if(n?.length){let s=!1;if(t){const o=Om(n,t,r);if(o.length){for(const a of o)this.addPropertyInstance(a,r,t);s=!0}}s||this.appendChild(Ef(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 la={},ca,mu;function Sc(){return mu||(mu=1,ca=class Uf{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 Uf(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()]}}),ca}var da={},gu;function Xg(){return gu||(gu=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 Br>"u"?da:Br:self)),da}/*!
280
+ `];Gi([ze()],vn.prototype,"offset",2);Gi([ze()],vn.prototype,"label",2);vn=Gi([Kr("rokit-slider-knob")],vn);class Ro extends HTMLElement{constructor(e,t,r,n){if(super(),this.template=new mg(r.store.getQuads(e,null,null,null),t,r),this.template.extendedShapes.length&&this.template.config.attributes.collapse!==null&&(!this.template.maxCount||this.template.maxCount>1)){const s=new di;s.classList.add("collapsible","shacl-group"),s.open=r.attributes.collapse==="open",s.label=this.template.label,this.container=s}else this.container=this;if(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.container.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,Fi));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)}r.editMode&&!t.linked&&(this.addEventListener("change",()=>{this.updateControls()}),this.updateControls()),this.container instanceof di&&(r.editMode&&!t.linked||this.container.childElementCount>0)&&this.appendChild(this.container)}addPropertyInstance(e){let t;if(this.template.shaclOr?.length||this.template.shaclXone?.length){const r=this.template.shaclOr?.length?this.template.shaclOr:this.template.shaclXone;let n=!1;if(e){const s=hg(r,e,this.template.config);s.length&&(t=go(this.template.clone().merge(s),e,!0),n=!0)}n||(t=sp(r,this,this.template.config),Ep(t,""))}else{let r=!1;if(e&&!(e instanceof yi)){const n=this.getRdfClassToLinkOrCreate();n&&this.template.config.store.countQuads(e,qt,n,Fi)===0&&(r=!0)}t=go(this.template,e,void 0,r||this.template.parent.linked)}return this.addButton?this.container.insertBefore(t,this.addButton):this.container.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),r&&this.addButton?.input&&this.addButton.input.updateMinWidth()}toRDF(e,t){for(const r of this.querySelectorAll(":scope > .property-instance, :scope > .collapsible > .property-instance")){const n=He.namedNode(r.dataset.path);if(r.firstChild instanceof yr){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=_g(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,qt,n,null)>0)return!0}return!1}createAddButton(){const e=new St;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=qc(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(()=>{ug(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 c of t){const l=document.createElement("li"),d=typeof c.value=="string"?c.value:c.value.value;l.innerText=c.label?c.label:d,l.dataset.value=JSON.stringify(c.value),n.appendChild(l)}e.appendChild(n),e.collapsibleWidth="250px",e.collapsibleOrientationLeft="",e.addEventListener("change",()=>{if(e.value==="new")this.addPropertyInstance();else{const c=JSON.parse(e.value);this.container.insertBefore(go(this.template,c,!0,!0),e)}e.value=""})}return e}}function go(i,e,t=!1,r=!1){let n;if(i.extendedShapes.length){n=document.createElement("div"),n.classList.add("property-instance");for(const s of i.extendedShapes)n.appendChild(new yr(s,i.config,e,i.parent,i.nodeKind,i.label,r))}else{const s=Sg(i.path,i.datatype?.value);s?i.config.editMode&&!r?n=s.createEditor(i,e):n=s.createViewer(i,e):n=yg(i,e||null,i.config.editMode&&!r),n.classList.add("property-instance"),r&&n.classList.add("linked")}return i.config.editMode&&Ep(n,i.label,t),n.dataset.path=i.path,n}function Ep(i,e,t=!1){const r=new bn;r.classList.add("remove-button","clear"),r.title="Remove "+e,r.dense=!0,r.icon=!0,r.addEventListener("click",n=>{i.classList.remove("fadeIn"),i.classList.add("fadeOut"),setTimeout(()=>{const s=i.parentElement;i.remove(),s?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),t&&r.classList.add("persistent"),i.appendChild(r)}window.customElements.define("shacl-property",Ro);function Sb(i,e){let t=i;const r=e.store.getQuads(i,null,null,null),n=gs(r,"label",Mc,e.languages);n&&(t=n);let s;if(e.attributes.collapse!==null)s=new di,s.classList.add("collapsible"),s.open=e.attributes.collapse==="open",s.label=t;else{s=document.createElement("div");const a=document.createElement("h1");a.innerText=t,s.appendChild(a)}s.dataset.subject=i,s.classList.add("shacl-group");const o=gs(r,"order");return o&&(s.style.order=o),s}const Dt=[];for(let i=0;i<256;++i)Dt.push((i+256).toString(16).slice(1));function kb(i,e=0){return(Dt[i[e+0]]+Dt[i[e+1]]+Dt[i[e+2]]+Dt[i[e+3]]+"-"+Dt[i[e+4]]+Dt[i[e+5]]+"-"+Dt[i[e+6]]+Dt[i[e+7]]+"-"+Dt[i[e+8]]+Dt[i[e+9]]+"-"+Dt[i[e+10]]+Dt[i[e+11]]+Dt[i[e+12]]+Dt[i[e+13]]+Dt[i[e+14]]+Dt[i[e+15]]).toLowerCase()}let Da;const Rb=new Uint8Array(16);function Ib(){if(!Da){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Da=crypto.getRandomValues.bind(crypto)}return Da(Rb)}const Tb=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ou={randomUUID:Tb};function Pu(i,e,t){if(Ou.randomUUID&&!i)return Ou.randomUUID();i=i||{};const r=i.random??i.rng?.()??Ib();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,kb(r)}class yr 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 c=r;if(!c){if(!s){const d=t.store.getObjects(e,`${Oe}nodeKind`,null);d.length&&(s=d[0])}s===void 0&&t.attributes.valuesNamespace||s?.value===`${Oe}IRI`?c=He.namedNode(t.attributes.valuesNamespace+Pu()):c=He.blankNode(Pu())}this.nodeId=c;const l=JSON.stringify([e,r]);if(r&&t.renderedNodes.has(l)){o=o||"Link";const d=document.createElement("label");d.innerText=o,d.classList.add("linked"),this.appendChild(d);const u=document.createElement("a");let p=r.termType==="BlankNode"?"_:"+r.value:r.value;u.innerText=p,u.classList.add("ref-link"),u.onclick=()=>{this.config.form.querySelector(`shacl-node[data-node-id='${p}']`)?.scrollIntoView()},this.appendChild(u),this.style.flexDirection="row"}else{if(r&&t.renderedNodes.add(l),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,jc,null,null))this.owlImports.push(d.object);for(const d of t.store.getQuads(e,null,null,null))switch(d.predicate.id){case Eo.id:this.addPropertyInstance(d.object,t,r);break;case`${Oe}and`:const u=t.lists[d.object.value];if(u?.length)for(const p of u)this.prepend(new yr(p,t,r,this));else console.error("list not found:",d.object.value,"existing lists:",t.lists);break;case`${Oe}node`:this.prepend(new yr(d.object,t,r,this));break;case`${Oe}targetClass`:this.targetClass=d.object;break;case`${Oe}or`:this.tryResolve(d.object,r,t);break;case`${Oe}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,qt,this.targetClass,this.config.valuesGraphId),this.config.attributes.generateNodeShapeReference&&!this.parent&&e.addQuad(t,He.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,`${Oe}group`,null,null);if(s.length>0){const a=s[0].object.value;if(t.groups.indexOf(a)>-1){let c=this.querySelector(`:scope > .shacl-group[data-subject='${a}']`);c||(c=Sb(a,t),this.appendChild(c)),n=c}else console.warn("ignoring unknown group reference",s[0],"existing groups:",t.groups)}const o=new Ro(e,this,t,r);o.childElementCount>0&&n.appendChild(o)}tryResolve(e,t,r){const n=r.lists[e.value];if(n?.length){let s=!1;if(t){const o=fg(n,t,r);if(o.length){for(const a of o)this.addPropertyInstance(a,r,t);s=!0}}s||this.appendChild(sp(n,this,r))}else console.error("list for sh:or/sh:xone not found:",e,"existing lists:",r.lists)}}window.customElements.define("shacl-node",yr);var Cr={},$r={},Ar={},Ji={},Mu;function Cb(){if(Mu)return Ji;Mu=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.removeDotSegmentsOfPath=Ji.removeDotSegments=Ji.resolve=void 0;function i(n,s){s=s||"";const o=s.indexOf("#");if(o>0&&(s=s.substr(0,o)),!n.length){if(s.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${s}' for value '${n}'`);return s}if(n.startsWith("?")){const g=s.indexOf("?");return g>0&&(s=s.substr(0,g)),s+n}if(n.startsWith("#"))return s+n;if(!s.length){const g=n.indexOf(":");if(g<0)throw new Error(`Found invalid relative IRI '${n}' for a missing baseIRI`);return t(n,g)}const a=n.indexOf(":");if(a>=0)return t(n,a);const c=s.indexOf(":");if(c<0)throw new Error(`Found invalid baseIRI '${s}' for value '${n}'`);const l=s.substr(0,c+1);if(n.indexOf("//")===0)return l+t(n,a);let d;if(s.indexOf("//",c)===c+1){if(d=s.indexOf("/",c+3),d<0)return s.length>c+3?s+"/"+t(n,a):l+t(n,a)}else if(d=s.indexOf("/",c+1),d<0)return l+t(n,a);if(n.indexOf("/")===0)return s.substr(0,d)+e(n);let u=s.substr(d);const p=u.lastIndexOf("/");return p>=0&&p<u.length-1&&(u=u.substr(0,p+1),n[0]==="."&&n[1]!=="."&&n[1]!=="/"&&n[2]&&(n=n.substr(1))),n=u+n,n=e(n),s.substr(0,d)+n}Ji.resolve=i;function e(n){const s=[];let o=0;for(;o<n.length;)switch(n[o]){case"/":if(n[o+1]===".")if(n[o+2]==="."){if(!r(n[o+3])){s.push([]),o++;break}s.pop(),n[o+3]||s.push([]),o+=3}else{if(!r(n[o+2])){s.push([]),o++;break}n[o+2]||s.push([]),o+=2}else s.push([]),o++;break;case"#":case"?":s.length||s.push([]),s[s.length-1].push(n.substr(o)),o=n.length;break;default:s.length||s.push([]),s[s.length-1].push(n[o]),o++;break}return"/"+s.map(a=>a.join("")).join("/")}Ji.removeDotSegments=e;function t(n,s){let o=s+1;s>=0?n[s+1]==="/"&&n[s+2]==="/"&&(o=s+3):n[0]==="/"&&n[1]==="/"&&(o=2);const a=n.indexOf("/",o);if(a<0)return n;const c=n.substr(0,a),l=n.substr(a);return c+e(l)}Ji.removeDotSegmentsOfPath=t;function r(n){return!n||n==="#"||n==="?"||n==="/"}return Ji}var Fu;function $b(){return Fu||(Fu=1,function(i){var e=Ar&&Ar.__createBinding||(Object.create?function(r,n,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return n[s]}})}:function(r,n,s,o){o===void 0&&(o=s),r[o]=n[s]}),t=Ar&&Ar.__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(Cb(),i)}(Ar)),Ar}var Nr={},La={},ju;function Ab(){return ju||(ju=1,function(i){/**
281
+ * Character classes and associated utilities for the 5th edition of XML 1.0.
282
+ *
283
+ * @author Louis-Dominique Dubeau
284
+ * @license MIT
285
+ * @copyright Louis-Dominique Dubeau
286
+ */Object.defineProperty(i,"__esModule",{value:!0}),i.CHAR=`
287
+ \r -퟿-�𐀀-􏿿`,i.S=` \r
288
+ `,i.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",i.NAME_CHAR="-"+i.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",i.CHAR_RE=new RegExp("^["+i.CHAR+"]$","u"),i.S_RE=new RegExp("^["+i.S+"]+$","u"),i.NAME_START_CHAR_RE=new RegExp("^["+i.NAME_START_CHAR+"]$","u"),i.NAME_CHAR_RE=new RegExp("^["+i.NAME_CHAR+"]$","u"),i.NAME_RE=new RegExp("^["+i.NAME_START_CHAR+"]["+i.NAME_CHAR+"]*$","u"),i.NMTOKEN_RE=new RegExp("^["+i.NAME_CHAR+"]+$","u");var e=9,t=10,r=13,n=32;i.S_LIST=[n,t,r,e];function s(l){return l>=n&&l<=55295||l===t||l===r||l===e||l>=57344&&l<=65533||l>=65536&&l<=1114111}i.isChar=s;function o(l){return l===n||l===t||l===r||l===e}i.isS=o;function a(l){return l>=65&&l<=90||l>=97&&l<=122||l===58||l===95||l===8204||l===8205||l>=192&&l<=214||l>=216&&l<=246||l>=248&&l<=767||l>=880&&l<=893||l>=895&&l<=8191||l>=8304&&l<=8591||l>=11264&&l<=12271||l>=12289&&l<=55295||l>=63744&&l<=64975||l>=65008&&l<=65533||l>=65536&&l<=983039}i.isNameStartChar=a;function c(l){return a(l)||l>=48&&l<=57||l===45||l===46||l===183||l>=768&&l<=879||l>=8255&&l<=8256}i.isNameChar=c}(La)),La}var Oa={},Bu;function Nb(){return Bu||(Bu=1,function(i){/**
289
+ * Character classes and associated utilities for the 2nd edition of XML 1.1.
290
+ *
291
+ * @author Louis-Dominique Dubeau
292
+ * @license MIT
293
+ * @copyright Louis-Dominique Dubeau
294
+ */Object.defineProperty(i,"__esModule",{value:!0}),i.CHAR="-퟿-�𐀀-􏿿",i.RESTRICTED_CHAR="-\b\v\f--„†-Ÿ",i.S=` \r
295
+ `,i.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",i.NAME_CHAR="-"+i.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",i.CHAR_RE=new RegExp("^["+i.CHAR+"]$","u"),i.RESTRICTED_CHAR_RE=new RegExp("^["+i.RESTRICTED_CHAR+"]$","u"),i.S_RE=new RegExp("^["+i.S+"]+$","u"),i.NAME_START_CHAR_RE=new RegExp("^["+i.NAME_START_CHAR+"]$","u"),i.NAME_CHAR_RE=new RegExp("^["+i.NAME_CHAR+"]$","u"),i.NAME_RE=new RegExp("^["+i.NAME_START_CHAR+"]["+i.NAME_CHAR+"]*$","u"),i.NMTOKEN_RE=new RegExp("^["+i.NAME_CHAR+"]+$","u");var e=9,t=10,r=13,n=32;i.S_LIST=[n,t,r,e];function s(u){return u>=1&&u<=55295||u>=57344&&u<=65533||u>=65536&&u<=1114111}i.isChar=s;function o(u){return u>=1&&u<=8||u===11||u===12||u>=14&&u<=31||u>=127&&u<=132||u>=134&&u<=159}i.isRestrictedChar=o;function a(u){return u===9||u===10||u===13||u>31&&u<127||u===133||u>159&&u<=55295||u>=57344&&u<=65533||u>=65536&&u<=1114111}i.isCharAndNotRestricted=a;function c(u){return u===n||u===t||u===r||u===e}i.isS=c;function l(u){return u>=65&&u<=90||u>=97&&u<=122||u===58||u===95||u===8204||u===8205||u>=192&&u<=214||u>=216&&u<=246||u>=248&&u<=767||u>=880&&u<=893||u>=895&&u<=8191||u>=8304&&u<=8591||u>=11264&&u<=12271||u>=12289&&u<=55295||u>=63744&&u<=64975||u>=65008&&u<=65533||u>=65536&&u<=983039}i.isNameStartChar=l;function d(u){return l(u)||u>=48&&u<=57||u===45||u===46||u===183||u>=768&&u<=879||u>=8255&&u<=8256}i.isNameChar=d}(Oa)),Oa}var Pa={},qu;function Db(){return qu||(qu=1,function(i){/**
296
+ * Character class utilities for XML NS 1.0 edition 3.
297
+ *
298
+ * @author Louis-Dominique Dubeau
299
+ * @license MIT
300
+ * @copyright Louis-Dominique Dubeau
301
+ */Object.defineProperty(i,"__esModule",{value:!0}),i.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",i.NC_NAME_CHAR="-"+i.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",i.NC_NAME_START_CHAR_RE=new RegExp("^["+i.NC_NAME_START_CHAR+"]$","u"),i.NC_NAME_CHAR_RE=new RegExp("^["+i.NC_NAME_CHAR+"]$","u"),i.NC_NAME_RE=new RegExp("^["+i.NC_NAME_START_CHAR+"]["+i.NC_NAME_CHAR+"]*$","u");function e(r){return r>=65&&r<=90||r===95||r>=97&&r<=122||r>=192&&r<=214||r>=216&&r<=246||r>=248&&r<=767||r>=880&&r<=893||r>=895&&r<=8191||r>=8204&&r<=8205||r>=8304&&r<=8591||r>=11264&&r<=12271||r>=12289&&r<=55295||r>=63744&&r<=64975||r>=65008&&r<=65533||r>=65536&&r<=983039}i.isNCNameStartChar=e;function t(r){return e(r)||r===45||r===46||r>=48&&r<=57||r===183||r>=768&&r<=879||r>=8255&&r<=8256}i.isNCNameChar=t}(Pa)),Pa}var Uu;function Lb(){if(Uu)return Nr;Uu=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.SaxesParser=Nr.EVENTS=void 0;const i=Ab(),e=Nb(),t=Db();var r=i.isS,n=i.isChar,s=i.isNameStartChar,o=i.isNameChar,a=i.S_LIST,c=i.NAME_RE,l=e.isChar,d=t.isNCNameStartChar,u=t.isNCNameChar,p=t.NC_NAME_RE;const g="http://www.w3.org/XML/1998/namespace",v="http://www.w3.org/2000/xmlns/",_={__proto__:null,xml:g,xmlns:v},E={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},x=-1,k=-2,y=0,h=1,m=2,T=3,N=4,C=5,F=6,I=7,O=8,U=9,R=10,D=11,Q=12,$=13,Y=14,B=15,re=16,S=17,H=18,ee=19,J=20,he=21,W=22,G=23,X=24,z=25,ne=26,se=27,ye=28,_e=29,M=30,K=31,ce=32,be=33,ve=34,xe=35,ie=36,me=37,Ee=38,fe=39,Ve=40,kt=41,Ue=42,Nt=43,A=44,f=9,b=10,j=13,te=32,ue=33,ge=34,Pe=38,nt=39,Je=45,Ye=47,Xe=59,Ii=60,cr=61,ft=62,mt=63,Gs=91,dr=93,Yr=133,Mn=8232,P=_t=>_t===ge||_t===nt,V=[ge,nt],Se=[...V,Gs,ft],ke=[...V,Ii,dr],Ce=[cr,mt,...a],Rt=[...a,ft,Pe,Ii];function Mt(_t,q,ae){switch(q){case"xml":ae!==g&&_t.fail(`xml prefix must be bound to ${g}.`);break;case"xmlns":ae!==v&&_t.fail(`xmlns prefix must be bound to ${v}.`);break}switch(ae){case v:_t.fail(q===""?`the default namespace may not be set to ${ae}.`:`may not assign a prefix (even "xmlns") to the URI ${v}.`);break;case g:switch(q){case"xml":break;case"":_t.fail(`the default namespace may not be set to ${ae}.`);break;default:_t.fail("may not assign the xml namespace to another prefix.")}break}}function Ks(_t,q){for(const ae of Object.keys(q))Mt(_t,ae,q[ae])}const Ki=_t=>p.test(_t),Xs=_t=>c.test(_t),Xi=0,Fn=1,Zr=2;Nr.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];const en={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class jn{get closed(){return this._closed}constructor(q){this.opt=q??{},this.fragmentOpt=!!this.opt.fragment;const ae=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,ae){this.nameStartCheck=d,this.nameCheck=u,this.isName=Ki,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},_);const le=this.opt.additionalNamespaces;le!=null&&(Ks(this,le),Object.assign(this.ns,le))}else this.nameStartCheck=s,this.nameCheck=o,this.isName=Xs,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}_init(){var q;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=Xi,this.attribList=[];const{fragmentOpt:ae}=this;this.state=ae?$:y,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=ae,this.xmlDeclPossible=!ae,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:le}=this.opt;if(le===void 0){if(this.opt.forceXMLVersion===!0)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");le="1.0"}this.setXMLVersion(le),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(E),(q=this.readyHandler)===null||q===void 0||q.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(q,ae){this[en[q]]=ae}off(q){this[en[q]]=void 0}makeError(q){var ae;let le=(ae=this.fileName)!==null&&ae!==void 0?ae:"";return this.trackPosition&&(le.length>0&&(le+=":"),le+=`${this.line}:${this.column}`),le.length>0&&(le+=": "),new Error(le+q)}fail(q){const ae=this.makeError(q),le=this.errorHandler;if(le===void 0)throw ae;return le(ae),this}write(q){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let ae=!1;q===null?(ae=!0,q=""):typeof q=="object"&&(q=q.toString()),this.carriedFromPrevious!==void 0&&(q=`${this.carriedFromPrevious}${q}`,this.carriedFromPrevious=void 0);let le=q.length;const Te=q.charCodeAt(le-1);!ae&&(Te===j||Te>=55296&&Te<=56319)&&(this.carriedFromPrevious=q[le-1],le--,q=q.slice(0,le));const{stateTable:Ge}=this;for(this.chunk=q,this.i=0;this.i<le;)Ge[this.state].call(this);return this.chunkPosition+=le,ae?this.end():this}close(){return this.write(null)}getCode10(){const{chunk:q,i:ae}=this;if(this.prevI=ae,this.i=ae+1,ae>=q.length)return x;const le=q.charCodeAt(ae);if(this.column++,le<55296){if(le>=te||le===f)return le;switch(le){case b:return this.line++,this.column=0,this.positionAtNewLine=this.position,b;case j:return q.charCodeAt(ae+1)===b&&(this.i=ae+2),this.line++,this.column=0,this.positionAtNewLine=this.position,k;default:return this.fail("disallowed character."),le}}if(le>56319)return le>=57344&&le<=65533||this.fail("disallowed character."),le;const Te=65536+(le-55296)*1024+(q.charCodeAt(ae+1)-56320);return this.i=ae+2,Te>1114111&&this.fail("disallowed character."),Te}getCode11(){const{chunk:q,i:ae}=this;if(this.prevI=ae,this.i=ae+1,ae>=q.length)return x;const le=q.charCodeAt(ae);if(this.column++,le<55296){if(le>31&&le<127||le>159&&le!==Mn||le===f)return le;switch(le){case b:return this.line++,this.column=0,this.positionAtNewLine=this.position,b;case j:{const Ge=q.charCodeAt(ae+1);(Ge===b||Ge===Yr)&&(this.i=ae+2)}case Yr:case Mn:return this.line++,this.column=0,this.positionAtNewLine=this.position,k;default:return this.fail("disallowed character."),le}}if(le>56319)return le>=57344&&le<=65533||this.fail("disallowed character."),le;const Te=65536+(le-55296)*1024+(q.charCodeAt(ae+1)-56320);return this.i=ae+2,Te>1114111&&this.fail("disallowed character."),Te}getCodeNorm(){const q=this.getCode();return q===k?b:q}unget(){this.i=this.prevI,this.column--}captureTo(q){let{i:ae}=this;const{chunk:le}=this;for(;;){const Te=this.getCode(),Ge=Te===k,Ze=Ge?b:Te;if(Ze===x||q.includes(Ze))return this.text+=le.slice(ae,this.prevI),Ze;Ge&&(this.text+=`${le.slice(ae,this.prevI)}
302
+ `,ae=this.i)}}captureToChar(q){let{i:ae}=this;const{chunk:le}=this;for(;;){let Te=this.getCode();switch(Te){case k:this.text+=`${le.slice(ae,this.prevI)}
303
+ `,ae=this.i,Te=b;break;case x:return this.text+=le.slice(ae),!1}if(Te===q)return this.text+=le.slice(ae,this.prevI),!0}}captureNameChars(){const{chunk:q,i:ae}=this;for(;;){const le=this.getCode();if(le===x)return this.name+=q.slice(ae),x;if(!o(le))return this.name+=q.slice(ae,this.prevI),le===k?b:le}}skipSpaces(){for(;;){const q=this.getCodeNorm();if(q===x||!r(q))return q}}setXMLVersion(q){this.currentXMLVersion=q,q==="1.0"?(this.isChar=n,this.getCode=this.getCode10):(this.isChar=l,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=h}sBeginWhitespace(){const q=this.i,ae=this.skipSpaces();switch(this.prevI!==q&&(this.xmlDeclPossible=!1),ae){case Ii:if(this.state=B,this.text.length!==0)throw new Error("no-empty text at start");break;case x:break;default:this.unget(),this.state=$,this.xmlDeclPossible=!1}}sDoctype(){var q;const ae=this.captureTo(Se);switch(ae){case ft:{(q=this.doctypeHandler)===null||q===void 0||q.call(this,this.text),this.text="",this.state=$,this.doctype=!0;break}case x:break;default:this.text+=String.fromCodePoint(ae),ae===Gs?this.state=N:P(ae)&&(this.state=T,this.q=ae)}}sDoctypeQuote(){const q=this.q;this.captureToChar(q)&&(this.text+=String.fromCodePoint(q),this.q=null,this.state=m)}sDTD(){const q=this.captureTo(ke);q!==x&&(this.text+=String.fromCodePoint(q),q===dr?this.state=m:q===Ii?this.state=F:P(q)&&(this.state=C,this.q=q))}sDTDQuoted(){const q=this.q;this.captureToChar(q)&&(this.text+=String.fromCodePoint(q),this.state=N,this.q=null)}sDTDOpenWaka(){const q=this.getCodeNorm();switch(this.text+=String.fromCodePoint(q),q){case ue:this.state=I,this.openWakaBang="";break;case mt:this.state=D;break;default:this.state=N}}sDTDOpenWakaBang(){const q=String.fromCodePoint(this.getCodeNorm()),ae=this.openWakaBang+=q;this.text+=q,ae!=="-"&&(this.state=ae==="--"?O:N,this.openWakaBang="")}sDTDComment(){this.captureToChar(Je)&&(this.text+="-",this.state=U)}sDTDCommentEnding(){const q=this.getCodeNorm();this.text+=String.fromCodePoint(q),this.state=q===Je?R:O}sDTDCommentEnded(){const q=this.getCodeNorm();this.text+=String.fromCodePoint(q),q===ft?this.state=N:(this.fail("malformed comment."),this.state=O)}sDTDPI(){this.captureToChar(mt)&&(this.text+="?",this.state=Q)}sDTDPIEnding(){const q=this.getCodeNorm();this.text+=String.fromCodePoint(q),q===ft&&(this.state=N)}sText(){this.tags.length!==0?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:q}=this;const{chunk:ae}=this;e:for(;;)switch(this.getCode()){case k:this.entity+=`${ae.slice(q,this.prevI)}
304
+ `,q=this.i;break;case Xe:{const{entityReturnState:le}=this,Te=this.entity+ae.slice(q,this.prevI);this.state=le;let Ge;Te===""?(this.fail("empty entity name."),Ge="&;"):(Ge=this.parseEntity(Te),this.entity=""),(le!==$||this.textHandler!==void 0)&&(this.text+=Ge);break e}case x:this.entity+=ae.slice(q);break e}}sOpenWaka(){const q=this.getCode();if(s(q))this.state=ve,this.unget(),this.xmlDeclPossible=!1;else switch(q){case Ye:this.state=Nt,this.xmlDeclPossible=!1;break;case ue:this.state=re,this.openWakaBang="",this.xmlDeclPossible=!1;break;case mt:this.state=G;break;default:this.fail("disallowed character in tag name"),this.state=$,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=J,this.openWakaBang="";break;case"--":this.state=S,this.openWakaBang="";break;case"DOCTYPE":this.state=m,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(Je)&&(this.state=H)}sCommentEnding(){var q;const ae=this.getCodeNorm();ae===Je?(this.state=ee,(q=this.commentHandler)===null||q===void 0||q.call(this,this.text),this.text=""):(this.text+=`-${String.fromCodePoint(ae)}`,this.state=S)}sCommentEnded(){const q=this.getCodeNorm();q!==ft?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(q)}`,this.state=S):this.state=$}sCData(){this.captureToChar(dr)&&(this.state=he)}sCDataEnding(){const q=this.getCodeNorm();q===dr?this.state=W:(this.text+=`]${String.fromCodePoint(q)}`,this.state=J)}sCDataEnding2(){var q;const ae=this.getCodeNorm();switch(ae){case ft:{(q=this.cdataHandler)===null||q===void 0||q.call(this,this.text),this.text="",this.state=$;break}case dr:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(ae)}`,this.state=J}}sPIFirstChar(){const q=this.getCodeNorm();this.nameStartCheck(q)?(this.piTarget+=String.fromCodePoint(q),this.state=X):q===mt||r(q)?(this.fail("processing instruction without a target."),this.state=q===mt?ne:z):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(q),this.state=X)}sPIRest(){const{chunk:q,i:ae}=this;for(;;){const le=this.getCodeNorm();if(le===x){this.piTarget+=q.slice(ae);return}if(!this.nameCheck(le)){this.piTarget+=q.slice(ae,this.prevI);const Te=le===mt;Te||r(le)?this.piTarget==="xml"?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=Te?be:se):this.state=Te?ne:z:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(le));break}}}sPIBody(){if(this.text.length===0){const q=this.getCodeNorm();q===mt?this.state=ne:r(q)||(this.text=String.fromCodePoint(q))}else this.captureToChar(mt)&&(this.state=ne)}sPIEnding(){var q;const ae=this.getCodeNorm();if(ae===ft){const{piTarget:le}=this;le.toLowerCase()==="xml"&&this.fail("the XML declaration must appear at the start of the document."),(q=this.piHandler)===null||q===void 0||q.call(this,{target:le,body:this.text}),this.piTarget=this.text="",this.state=$}else ae===mt?this.text+="?":(this.text+=`?${String.fromCodePoint(ae)}`,this.state=z);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const q=this.skipSpaces();if(q===mt){this.state=be;return}q!==x&&(this.state=ye,this.name=String.fromCodePoint(q))}sXMLDeclName(){const q=this.captureTo(Ce);if(q===mt){this.state=be,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(r(q)||q===cr){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=q===cr?M:_e}}sXMLDeclEq(){const q=this.getCodeNorm();if(q===mt){this.state=be,this.fail("XML declaration is incomplete.");return}r(q)||(q!==cr&&this.fail("value required."),this.state=M)}sXMLDeclValueStart(){const q=this.getCodeNorm();if(q===mt){this.state=be,this.fail("XML declaration is incomplete.");return}r(q)||(P(q)?this.q=q:(this.fail("value must be quoted."),this.q=te),this.state=K)}sXMLDeclValue(){const q=this.captureTo([this.q,mt]);if(q===mt){this.state=be,this.text="",this.fail("XML declaration is incomplete.");return}if(q===x)return;const ae=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const le=ae;this.xmlDecl.version=le,/^1\.[0-9]+$/.test(le)?this.opt.forceXMLVersion||this.setXMLVersion(le):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(ae)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=ae;break;case"standalone":ae!=="yes"&&ae!=="no"&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=ae;break}this.name="",this.state=ce}sXMLDeclSeparator(){const q=this.getCodeNorm();if(q===mt){this.state=be;return}r(q)||(this.fail("whitespace required."),this.unget()),this.state=se}sXMLDeclEnding(){var q;this.getCodeNorm()===ft?(this.piTarget!=="xml"?this.fail("processing instructions are not allowed before root."):this.name!=="version"&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),(q=this.xmldeclHandler)===null||q===void 0||q.call(this,this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=$):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){var q;const ae=this.captureNameChars();if(ae===x)return;const le=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=le.ns=Object.create(null)),(q=this.openTagStartHandler)===null||q===void 0||q.call(this,le),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),ae){case ft:this.openTag();break;case Ye:this.state=xe;break;default:r(ae)||this.fail("disallowed character in tag name."),this.state=ie}}sOpenTagSlash(){this.getCode()===ft?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=ie)}sAttrib(){const q=this.skipSpaces();q!==x&&(s(q)?(this.unget(),this.state=me):q===ft?this.openTag():q===Ye?this.state=xe:this.fail("disallowed character in attribute name."))}sAttribName(){const q=this.captureNameChars();q===cr?this.state=fe:r(q)?this.state=Ee:q===ft?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):q!==x&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const q=this.skipSpaces();switch(q){case x:return;case cr:this.state=fe;break;default:this.fail("attribute without value."),this.text="",this.name="",q===ft?this.openTag():s(q)?(this.unget(),this.state=me):(this.fail("disallowed character in attribute name."),this.state=ie)}}sAttribValue(){const q=this.getCodeNorm();P(q)?(this.q=q,this.state=Ve):r(q)||(this.fail("unquoted attribute value."),this.state=Ue,this.unget())}sAttribValueQuoted(){const{q,chunk:ae}=this;let{i:le}=this;for(;;)switch(this.getCode()){case q:this.pushAttrib(this.name,this.text+ae.slice(le,this.prevI)),this.name=this.text="",this.q=null,this.state=kt;return;case Pe:this.text+=ae.slice(le,this.prevI),this.state=Y,this.entityReturnState=Ve;return;case b:case k:case f:this.text+=`${ae.slice(le,this.prevI)} `,le=this.i;break;case Ii:this.text+=ae.slice(le,this.prevI),this.fail("disallowed character.");return;case x:this.text+=ae.slice(le);return}}sAttribValueClosed(){const q=this.getCodeNorm();r(q)?this.state=ie:q===ft?this.openTag():q===Ye?this.state=xe:s(q)?(this.fail("no whitespace between attributes."),this.unget(),this.state=me):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const q=this.captureTo(Rt);switch(q){case Pe:this.state=Y,this.entityReturnState=Ue;break;case Ii:this.fail("disallowed character.");break;case x:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",q===ft?this.openTag():this.state=ie}}sCloseTag(){const q=this.captureNameChars();q===ft?this.closeTag():r(q)?this.state=A:q!==x&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case ft:this.closeTag();break;case x:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:q,forbiddenState:ae}=this;const{chunk:le,textHandler:Te}=this;e:for(;;)switch(this.getCode()){case Ii:{if(this.state=B,Te!==void 0){const{text:Ge}=this,Ze=le.slice(q,this.prevI);Ge.length!==0?(Te(Ge+Ze),this.text=""):Ze.length!==0&&Te(Ze)}ae=Xi;break e}case Pe:this.state=Y,this.entityReturnState=$,Te!==void 0&&(this.text+=le.slice(q,this.prevI)),ae=Xi;break e;case dr:switch(ae){case Xi:ae=Fn;break;case Fn:ae=Zr;break;case Zr:break;default:throw new Error("impossible state")}break;case ft:ae===Zr&&this.fail('the string "]]>" is disallowed in char data.'),ae=Xi;break;case k:Te!==void 0&&(this.text+=`${le.slice(q,this.prevI)}
305
+ `),q=this.i,ae=Xi;break;case x:Te!==void 0&&(this.text+=le.slice(q));break e;default:ae=Xi}this.forbiddenState=ae}handleTextOutsideRoot(){let{i:q}=this;const{chunk:ae,textHandler:le}=this;let Te=!1;e:for(;;){const Ge=this.getCode();switch(Ge){case Ii:{if(this.state=B,le!==void 0){const{text:Ze}=this,Ft=ae.slice(q,this.prevI);Ze.length!==0?(le(Ze+Ft),this.text=""):Ft.length!==0&&le(Ft)}break e}case Pe:this.state=Y,this.entityReturnState=$,le!==void 0&&(this.text+=ae.slice(q,this.prevI)),Te=!0;break e;case k:le!==void 0&&(this.text+=`${ae.slice(q,this.prevI)}
306
+ `),q=this.i;break;case x:le!==void 0&&(this.text+=ae.slice(q));break e;default:r(Ge)||(Te=!0)}}Te&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(q,ae){var le;const{prefix:Te,local:Ge}=this.qname(q),Ze={name:q,prefix:Te,local:Ge,value:ae};if(this.attribList.push(Ze),(le=this.attributeHandler)===null||le===void 0||le.call(this,Ze),Te==="xmlns"){const Ft=ae.trim();this.currentXMLVersion==="1.0"&&Ft===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[Ge]=Ft,Mt(this,Ge,Ft)}else if(q==="xmlns"){const Ft=ae.trim();this.topNS[""]=Ft,Mt(this,"",Ft)}}pushAttribPlain(q,ae){var le;const Te={name:q,value:ae};this.attribList.push(Te),(le=this.attributeHandler)===null||le===void 0||le.call(this,Te)}end(){var q,ae;this.sawRoot||this.fail("document must contain a root element.");const{tags:le}=this;for(;le.length>0;){const Ge=le.pop();this.fail(`unclosed tag: ${Ge.name}`)}this.state!==y&&this.state!==$&&this.fail("unexpected end.");const{text:Te}=this;return Te.length!==0&&((q=this.textHandler)===null||q===void 0||q.call(this,Te),this.text=""),this._closed=!0,(ae=this.endHandler)===null||ae===void 0||ae.call(this),this._init(),this}resolve(q){var ae,le;let Te=this.topNS[q];if(Te!==void 0)return Te;const{tags:Ge}=this;for(let Ze=Ge.length-1;Ze>=0;Ze--)if(Te=Ge[Ze].ns[q],Te!==void 0)return Te;return Te=this.ns[q],Te!==void 0?Te:(le=(ae=this.opt).resolvePrefix)===null||le===void 0?void 0:le.call(ae,q)}qname(q){const ae=q.indexOf(":");if(ae===-1)return{prefix:"",local:q};const le=q.slice(ae+1),Te=q.slice(0,ae);return(Te===""||le===""||le.includes(":"))&&this.fail(`malformed name: ${q}.`),{prefix:Te,local:le}}processAttribsNS(){var q;const{attribList:ae}=this,le=this.tag;{const{prefix:Ze,local:Ft}=this.qname(le.name);le.prefix=Ze,le.local=Ft;const tn=le.uri=(q=this.resolve(Ze))!==null&&q!==void 0?q:"";Ze!==""&&(Ze==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),tn===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(Ze)}.`),le.uri=Ze))}if(ae.length===0)return;const{attributes:Te}=le,Ge=new Set;for(const Ze of ae){const{name:Ft,prefix:tn,local:Im}=Ze;let rn,Bn;tn===""?(rn=Ft==="xmlns"?v:"",Bn=Ft):(rn=this.resolve(tn),rn===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(tn)}.`),rn=tn),Bn=`{${rn}}${Im}`),Ge.has(Bn)&&this.fail(`duplicate attribute: ${Bn}.`),Ge.add(Bn),Ze.uri=rn,Te[Ft]=Ze}this.attribList=[]}processAttribsPlain(){const{attribList:q}=this,ae=this.tag.attributes;for(const{name:le,value:Te}of q)ae[le]!==void 0&&this.fail(`duplicate attribute: ${le}.`),ae[le]=Te;this.attribList=[]}openTag(){var q;this.processAttribs();const{tags:ae}=this,le=this.tag;le.isSelfClosing=!1,(q=this.openTagHandler)===null||q===void 0||q.call(this,le),ae.push(le),this.state=$,this.name=""}openSelfClosingTag(){var q,ae,le;this.processAttribs();const{tags:Te}=this,Ge=this.tag;Ge.isSelfClosing=!0,(q=this.openTagHandler)===null||q===void 0||q.call(this,Ge),(ae=this.closeTagHandler)===null||ae===void 0||ae.call(this,Ge),(this.tag=(le=Te[Te.length-1])!==null&&le!==void 0?le:null)===null&&(this.closedRoot=!0),this.state=$,this.name=""}closeTag(){const{tags:q,name:ae}=this;if(this.state=$,this.name="",ae===""){this.fail("weird empty close tag."),this.text+="</>";return}const le=this.closeTagHandler;let Te=q.length;for(;Te-- >0;){const Ge=this.tag=q.pop();if(this.topNS=Ge.ns,le?.(Ge),Ge.name===ae)break;this.fail("unexpected close tag.")}Te===0?this.closedRoot=!0:Te<0&&(this.fail(`unmatched closing tag: ${ae}.`),this.text+=`</${ae}>`)}parseEntity(q){if(q[0]!=="#"){const le=this.ENTITIES[q];return le!==void 0?le:(this.fail(this.isName(q)?"undefined entity.":"disallowed character in entity name."),`&${q};`)}let ae=NaN;return q[1]==="x"&&/^#x[0-9a-f]+$/i.test(q)?ae=parseInt(q.slice(2),16):/^#[0-9]+$/.test(q)&&(ae=parseInt(q.slice(1),10)),this.isChar(ae)?String.fromCodePoint(ae):(this.fail("malformed character entity."),`&${q};`)}}return Nr.SaxesParser=jn,Nr}var Xn={},Vu;function Ob(){if(Vu)return Xn;Vu=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.ParseError=void 0;let i=class extends Error{constructor(t,r){const n=t.saxParser;super(t.trackPosition?`Line ${n.line} column ${n.column+1}: ${r}`:r)}};return Xn.ParseError=i,Xn}var Dr={},Jn={},zu;function Sp(){if(zu)return Jn;zu=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.BlankNode=void 0;class i{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&t.termType==="BlankNode"&&t.value===this.value}}return Jn.BlankNode=i,Jn}var Qn={},Yn={},Hu;function kp(){if(Hu)return Yn;Hu=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.DefaultGraph=void 0;class i{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&t.termType==="DefaultGraph"}}return Yn.DefaultGraph=i,i.INSTANCE=new i,Yn}var Zn={},es={},Wu;function Yc(){if(Wu)return es;Wu=1,Object.defineProperty(es,"__esModule",{value:!0}),es.NamedNode=void 0;class i{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&t.termType==="NamedNode"&&t.value===this.value}}return es.NamedNode=i,es}var Gu;function Rp(){if(Gu)return Zn;Gu=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.Literal=void 0;const i=Yc();class e{constructor(r,n){this.termType="Literal",this.value=r,typeof n=="string"?(this.language=n,this.datatype=e.RDF_LANGUAGE_STRING,this.direction=""):n?"termType"in n?(this.language="",this.datatype=n,this.direction=""):(this.language=n.language,this.datatype=n.direction?e.RDF_DIRECTIONAL_LANGUAGE_STRING:e.RDF_LANGUAGE_STRING,this.direction=n.direction||""):(this.language="",this.datatype=e.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 Zn.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"),Zn}var ts={},Ku;function Ip(){if(Ku)return ts;Ku=1,Object.defineProperty(ts,"__esModule",{value:!0}),ts.Quad=void 0;class i{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 ts.Quad=i,ts}var is={},Xu;function Tp(){if(Xu)return is;Xu=1,Object.defineProperty(is,"__esModule",{value:!0}),is.Variable=void 0;class i{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&t.termType==="Variable"&&t.value===this.value}}return is.Variable=i,is}var Ju;function Pb(){if(Ju)return Qn;Ju=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.DataFactory=void 0;const i=Sp(),e=kp(),t=Rp(),r=Yc(),n=Ip(),s=Tp();let o=0;class a{constructor(l){this.blankNodeCounter=0,l=l||{},this.blankNodePrefix=l.blankNodePrefix||`df_${o++}_`}namedNode(l){return new r.NamedNode(l)}blankNode(l){return new i.BlankNode(l||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(l,d){return new t.Literal(l,d)}variable(l){return new s.Variable(l)}defaultGraph(){return e.DefaultGraph.INSTANCE}quad(l,d,u,p){return new n.Quad(l,d,u,p||this.defaultGraph())}fromTerm(l){switch(l.termType){case"NamedNode":return this.namedNode(l.value);case"BlankNode":return this.blankNode(l.value);case"Literal":return l.language?this.literal(l.value,l.language):l.datatype.equals(t.Literal.XSD_STRING)?this.literal(l.value):this.literal(l.value,this.fromTerm(l.datatype));case"Variable":return this.variable(l.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(l.subject),this.fromTerm(l.predicate),this.fromTerm(l.object),this.fromTerm(l.graph))}}fromQuad(l){return this.fromTerm(l)}resetBlankNodeCounter(){this.blankNodeCounter=0}}return Qn.DataFactory=a,Qn}var Qu;function Cp(){return Qu||(Qu=1,function(i){var e=Dr&&Dr.__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=Dr&&Dr.__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(Sp(),i),t(Pb(),i),t(kp(),i),t(Rp(),i),t(Yc(),i),t(Ip(),i),t(Tp(),i)}(Dr)),Dr}var Lr={},Ma={},Yu;function Mb(){return Yu||(Yu=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.validateIri=i.IriValidationStrategy=void 0;function e(){const a="[!$&'()*+,;=]",c="%[a-fA-F0-9]{2}",l="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",d=`${l}\\.${l}\\.${l}\\.${l}`,u="[a-fA-F0-9]{1,4}",p=`(${u}:${u}|${d})`,g=`((${u}:){6}${p}|::(${u}:){5}${p}|(${u})?::(${u}:){4}${p}|((${u}:){0,1}${u})?::(${u}:){3}${p}|((${u}:){0,2}${u})?::(${u}:){2}${p}|((${u}:){0,3}${u})?::${u}:${p}|((${u}:){0,4}${u})?::${p}|((${u}:){0,5}${u})?::${u}|((${u}:){0,6}${u})?::)`,v=`v[a-fA-F0-9]+\\.(${a}|${a}|":)+`,_=`\\[(${g}|${v})\\]`,E="[0-9]*",x="[a-zA-Z][a-zA-Z0-9+\\-.]*",y="[-󰀀-󿿽􀀀-􏿽]",T="[a-zA-Z0-9\\-._~ -퟿豈-﷏ﷰ-￯𐀀-🿽𠀀-𯿽𰀀-𿿽񀀀-񏿽񐀀-񟿽񠀀-񯿽񰀀-񿿽򀀀-򏿽򐀀-򟿽򠀀-򯿽򰀀-򿿽󀀀-󏿽󐀀-󟿽󡀀-󯿽]",N=`(${T}|${c}|${a}|[:@])*`,C=`(${N}|[\\/?])*`,F=`(${N}|${y}|[\\/?])*`,I=`(${N})+`,O=`(${N})*`,U="",R=`${I}(\\/${O})*`,D=`\\/(${I}(\\/${O})*)?`,Q=`(\\/${O})*`,$=`(${T}|${c}|${a})*`,Y=`(${_}|${d}|${$})`,S=`(\\/\\/${`(${`(${T}|${c}|${a}|:)*`}@)?${Y}(:${E})?`}${Q}|${D}|${R}|${U})`,H=`^${x}:${S}(\\?${F})?(#${C})?$`;return new RegExp(H,"u")}const t=e(),r=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u;var n;(function(o){o.Strict="strict",o.Pragmatic="pragmatic",o.None="none"})(n=i.IriValidationStrategy||(i.IriValidationStrategy={}));function s(o,a=n.Strict){switch(a){case n.Strict:return t.test(o)?void 0:new Error(`Invalid IRI according to RFC 3987: '${o}'`);case n.Pragmatic:return r.test(o)?void 0:new Error(`Invalid IRI according to RDF Turtle: '${o}'`);case n.None:return;default:return new Error(`Not supported validation strategy "${a}"`)}}i.validateIri=s}(Ma)),Ma}var Zu;function Fb(){return Zu||(Zu=1,function(i){var e=Lr&&Lr.__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=Lr&&Lr.__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(Mb(),i)}(Lr)),Lr}var eh;function jb(){if(eh)return $r;eh=1,Object.defineProperty($r,"__esModule",{value:!0}),$r.ParseType=$r.RdfXmlParser=void 0;const i=$b(),e=Lb(),t=Zf(),r=Ob(),n=Cp(),s=Fb();let o=class tt extends t.Transform{constructor(l){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},l&&(Object.assign(this,l),this.options=l),this.dataFactory||(this.dataFactory=new n.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.validateUri!==!1&&(this.validateUri=!0),this.iriValidationStrategy||(this.iriValidationStrategy=this.validateUri?s.IriValidationStrategy.Pragmatic:s.IriValidationStrategy.None),this.saxParser=new e.SaxesParser({xmlns:!0,position:this.trackPosition}),this.attachSaxListeners()}import(l){const d=new t.PassThrough({readableObjectMode:!0});l.on("error",p=>u.emit("error",p)),l.on("data",p=>d.push(p)),l.on("end",()=>d.push(null));const u=d.pipe(new tt(this.options));return u}_transform(l,d,u){try{this.saxParser.write(l)}catch(p){return u(p)}u()}newParseError(l){return new r.ParseError(this,l)}valueToUri(l,d){return this.uriToNamedNode((0,i.resolve)(l,d.baseIRI))}uriToNamedNode(l){const d=(0,s.validateIri)(l,this.iriValidationStrategy);if(d instanceof Error)throw this.newParseError(d.message);return this.dataFactory.namedNode(l)}validateNcname(l){if(!tt.NCNAME_MATCHER.test(l))throw this.newParseError(`Not a valid NCName: ${l}`)}createLiteral(l,d){return this.dataFactory.literal(l,d.datatype?d.datatype:d.language?{language:d.language,direction:d.rdfVersion?d.direction:void 0}:void 0)}attachSaxListeners(){this.saxParser.on("error",l=>this.emit("error",l)),this.saxParser.on("opentag",this.onTag.bind(this)),this.saxParser.on("text",this.onText.bind(this)),this.saxParser.on("cdata",this.onText.bind(this)),this.saxParser.on("closetag",this.onCloseTag.bind(this)),this.saxParser.on("doctype",this.onDoctype.bind(this))}onTag(l){const d=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let u=a.RESOURCE;if(d&&(d.hadChildren=!0,u=d.childrenParseType),d&&d.childrenStringTags){const g=l.name;let v="";for(const{key:k,value:y}of d.namespaces||[])v+=` ${k}="${y}"`;for(const k in l.attributes)v+=` ${k}="${l.attributes[k].value}"`;const E=`<${`${g}${v}`}>`;d.childrenStringTags.push(E);const x={childrenStringTags:d.childrenStringTags};x.childrenStringEmitClosingTag=`</${g}>`,this.activeTagStack.push(x);return}const p={};d?(p.language=d.language,p.direction=d.direction,p.baseIRI=d.baseIRI,p.childrenTripleTerms=d.childrenTripleTerms,p.rdfVersion=d.rdfVersion):p.baseIRI=this.baseIRI,this.activeTagStack.push(p),u===a.RESOURCE?this.onTagResource(l,p,d,!d):this.onTagProperty(l,p,d);for(const g in l.attributes){const v=l.attributes[g];v.prefix==="xmlns"&&(p.namespaces||(p.namespaces=[]),p.namespaces.push({key:`${v.prefix}:${v.local}`,value:v.value}))}d&&d.namespaces&&(p.namespaces=[...p.namespaces||[],...d.namespaces])}onTagResource(l,d,u,p){d.childrenParseType=a.PROPERTY;let g=!0;if(l.uri===tt.RDF){if(!p&&tt.FORBIDDEN_NODE_ELEMENTS.indexOf(l.local)>=0)throw this.newParseError(`Illegal node element name: ${l.local}`);switch(l.local){case"RDF":d.childrenParseType=a.RESOURCE;case"Description":g=!1}}const v=[],_=[];let E=null,x=!1,k=!1,y=null;for(const h in l.attributes){const m=l.attributes[h];if(m.uri===tt.RDF&&m.local==="version"){this.setVersion(d,m.value);continue}else if(u&&m.uri===tt.RDF)switch(m.local){case"about":if(E)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${m.value} and ${E} where found.`);E=m.value;continue;case"ID":if(E)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${m.value} and ${E} where found.`);this.validateNcname(m.value),E="#"+m.value,x=!0;continue;case"nodeID":if(E)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${m.value} and ${E} where found.`);this.validateNcname(m.value),E=m.value,k=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":y=m.value;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(m.uri===tt.XML){if(m.local==="lang"){d.language=m.value===""?null:m.value.toLowerCase();continue}else if(m.local==="base"){d.baseIRI=(0,i.resolve)(m.value,d.baseIRI);continue}}else if(m.uri===tt.ITS&&m.local==="dir"){this.setDirection(d,m.value);continue}m.prefix!=="xml"&&m.prefix!=="xmlns"&&(m.prefix!==""||m.local!=="xmlns")&&m.uri&&(v.push(this.uriToNamedNode(m.uri+m.local)),_.push(m.value))}if(E!==null&&(d.subject=k?this.dataFactory.blankNode(E):this.valueToUri(E,d),x&&this.claimNodeId(d.subject)),d.subject||(d.subject=this.dataFactory.blankNode()),g){const h=this.uriToNamedNode(l.uri+l.local);this.emitTriple(d.subject,this.dataFactory.namedNode(tt.RDF+"type"),h,u?u.reifiedStatementId:null,d.childrenTripleTerms,d.reifier)}if(u){if(u.predicate)if(u.childrenCollectionSubject){const h=this.dataFactory.blankNode(),m=this.dataFactory.namedNode(tt.RDF+"rest"),T=u.childrenCollectionPredicate.equals(m);this.emitTriple(u.childrenCollectionSubject,u.childrenCollectionPredicate,h,T?null:u.reifiedStatementId,u.childrenTripleTerms,T?null:u.reifier),this.emitTriple(h,this.dataFactory.namedNode(tt.RDF+"first"),d.subject,null,d.childrenTripleTerms),u.childrenCollectionSubject=h,u.childrenCollectionPredicate=m}else{u.childrenTagsToTripleTerms||(this.emitTriple(u.subject,u.predicate,d.subject,u.reifiedStatementId,u.childrenTripleTerms,u.reifier),u.predicateEmitted=!0);for(let h=0;h<u.predicateSubPredicates.length;h++)this.emitTriple(d.subject,u.predicateSubPredicates[h],u.predicateSubObjects[h],null,u.childrenTripleTerms,u.reifier);u.predicateSubPredicates=[],u.predicateSubObjects=[]}for(let h=0;h<v.length;h++){const m=this.createLiteral(_[h],d);this.emitTriple(d.subject,v[h],m,u.reifiedStatementId,u.childrenTripleTerms,u.reifier)}y&&this.emitTriple(d.subject,this.dataFactory.namedNode(tt.RDF+"type"),this.uriToNamedNode(y),null,d.childrenTripleTerms,d.reifier)}}onTagProperty(l,d,u){if(d.childrenParseType=a.RESOURCE,d.subject=u.subject,l.uri===tt.RDF&&l.local==="li"?(u.listItemCounter||(u.listItemCounter=1),d.predicate=this.uriToNamedNode(l.uri+"_"+u.listItemCounter++)):d.predicate=this.uriToNamedNode(l.uri+l.local),l.uri===tt.RDF&&tt.FORBIDDEN_PROPERTY_ELEMENTS.indexOf(l.local)>=0)throw this.newParseError(`Illegal property element name: ${l.local}`);d.predicateSubPredicates=[],d.predicateSubObjects=[];let p=!1,g=!1,v=null,_=!0;const E=[],x=[];for(const k in l.attributes){const y=l.attributes[k];if(y.uri===tt.RDF&&y.local==="version"){this.setVersion(d,y.value);continue}else if(y.uri===tt.RDF)switch(y.local){case"resource":if(v)throw this.newParseError(`Found both rdf:resource (${y.value}) and rdf:nodeID (${v}).`);if(p)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${y.value})`);d.hadChildren=!0,v=y.value,_=!1;continue;case"datatype":if(g)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${y.value}).`);if(p)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${y.value})`);d.datatype=this.valueToUri(y.value,d);continue;case"nodeID":if(g)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${y.value}).`);if(d.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${y.value}).`);if(p)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${y.value})`);this.validateNcname(y.value),d.hadChildren=!0,v=y.value,_=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(g)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(d.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${d.datatype.value})`);if(v)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${v})`);if(y.value==="Resource"){p=!0,d.childrenParseType=a.PROPERTY;const h=this.dataFactory.blankNode();this.emitTriple(d.subject,d.predicate,h,d.reifiedStatementId,d.childrenTripleTerms,d.reifier),d.subject=h,d.predicate=null}else y.value==="Collection"?(p=!0,d.hadChildren=!0,d.childrenCollectionSubject=d.subject,d.childrenCollectionPredicate=d.predicate,_=!1):y.value==="Literal"?(p=!0,d.childrenTagsToString=!0,d.childrenStringTags=[]):y.value==="Triple"&&(p=!0,d.childrenTagsToTripleTerms=!0,d.childrenTripleTerms=[]);continue;case"ID":this.validateNcname(y.value),d.reifiedStatementId=this.valueToUri("#"+y.value,d),this.claimNodeId(d.reifiedStatementId);continue;case"annotation":d.reifier=this.dataFactory.namedNode(y.value);continue;case"annotationNodeID":d.reifier=this.dataFactory.blankNode(y.value);continue}else if(y.uri===tt.XML&&y.local==="lang"){d.language=y.value===""?null:y.value.toLowerCase();continue}else if(y.uri===tt.ITS&&y.local==="dir"){this.setDirection(d,y.value);continue}else if(y.uri===tt.ITS&&y.local==="version")continue;if(y.prefix!=="xml"&&y.prefix!=="xmlns"&&(y.prefix!==""||y.local!=="xmlns")&&y.uri){if(p||d.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${y.value}`);d.hadChildren=!0,g=!0,E.push(this.uriToNamedNode(y.uri+y.local)),x.push(this.createLiteral(y.value,d))}}if(v!==null){const k=d.subject;d.subject=_?this.dataFactory.blankNode(v):this.valueToUri(v,d),this.emitTriple(k,d.predicate,d.subject,d.reifiedStatementId,d.childrenTripleTerms,d.reifier);for(let y=0;y<E.length;y++)this.emitTriple(d.subject,E[y],x[y],null,d.childrenTripleTerms,d.reifier);d.predicateEmitted=!0}else _&&(d.predicateSubPredicates=E,d.predicateSubObjects=x,d.predicateEmitted=!1)}emitTriple(l,d,u,p,g,v){const _=this.dataFactory.quad(l,d,u,this.defaultGraph);g?g.push(_):this.push(_),v&&this.push(this.dataFactory.quad(v,this.dataFactory.namedNode(tt.RDF+"reifies"),_)),p&&(this.push(this.dataFactory.quad(p,this.dataFactory.namedNode(tt.RDF+"type"),this.dataFactory.namedNode(tt.RDF+"Statement"),this.defaultGraph)),this.push(this.dataFactory.quad(p,this.dataFactory.namedNode(tt.RDF+"subject"),l,this.defaultGraph)),this.push(this.dataFactory.quad(p,this.dataFactory.namedNode(tt.RDF+"predicate"),d,this.defaultGraph)),this.push(this.dataFactory.quad(p,this.dataFactory.namedNode(tt.RDF+"object"),u,this.defaultGraph)))}claimNodeId(l){if(!this.allowDuplicateRdfIds){if(this.nodeIds[l.value])throw this.newParseError(`Found multiple occurrences of rdf:ID='${l.value}'.`);this.nodeIds[l.value]=!0}}onText(l){const d=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;d&&(d.childrenStringTags?d.childrenStringTags.push(l):d.predicate&&(d.text=l))}onCloseTag(){const l=this.activeTagStack.pop(),d=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;if(l.childrenStringEmitClosingTag&&l.childrenStringTags.push(l.childrenStringEmitClosingTag),l.childrenTagsToString&&(l.datatype=this.dataFactory.namedNode(tt.RDF+"XMLLiteral"),l.text=l.childrenStringTags.join(""),l.hadChildren=!1),l.childrenTagsToTripleTerms&&l.predicate&&l.rdfVersion){if(l.childrenTripleTerms.length!==1)throw this.newParseError(`Expected exactly one triple term in rdf:parseType="Triple" but got ${l.childrenTripleTerms.length}`);for(const u of l.childrenTripleTerms)this.emitTriple(l.subject,l.predicate,u,null,d.childrenTripleTerms,d.reifier);l.predicateEmitted=!0}if(l.childrenCollectionSubject)this.emitTriple(l.childrenCollectionSubject,l.childrenCollectionPredicate,this.dataFactory.namedNode(tt.RDF+"nil"),null,l.childrenTripleTerms);else if(l.predicate){if(!l.hadChildren&&l.childrenParseType!==a.PROPERTY)this.emitTriple(l.subject,l.predicate,this.createLiteral(l.text||"",l),l.reifiedStatementId,l.childrenTripleTerms,l.reifier);else if(!l.predicateEmitted){const u=this.dataFactory.blankNode();this.emitTriple(l.subject,l.predicate,u,l.reifiedStatementId,l.childrenTripleTerms,l.reifier);for(let p=0;p<l.predicateSubPredicates.length;p++)this.emitTriple(u,l.predicateSubPredicates[p],l.predicateSubObjects[p],null,l.childrenTripleTerms)}}}onDoctype(l){l.replace(/<!ENTITY\s+([^\s]+)\s+["']([^"']+)["']\s*>/g,(d,u,p)=>(this.saxParser.ENTITIES[u]=p,""))}setDirection(l,d){if(d){if(d!=="ltr"&&d!=="rtl")throw this.newParseError(`Base directions must either be 'ltr' or 'rtl', while '${d}' was found.`);l.direction=d}else delete l.direction}setVersion(l,d){l.rdfVersion=d,this.emit("version",d)}};$r.RdfXmlParser=o,o.MIME_TYPE="application/rdf+xml",o.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",o.XML="http://www.w3.org/XML/1998/namespace",o.ITS="http://www.w3.org/2005/11/its",o.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],o.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],o.NCNAME_MATCHER=/^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u;var a;return function(c){c[c.RESOURCE=0]="RESOURCE",c[c.PROPERTY=1]="PROPERTY"}(a||($r.ParseType=a={})),$r}var th;function Bb(){return th||(th=1,function(i){var e=Cr&&Cr.__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=Cr&&Cr.__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(jb(),i)}(Cr)),Cr}var qb=Bb(),Fa={},ja,ih;function Zc(){return ih||(ih=1,ja=class $p{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 $p(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()]}}),ja}var Ba={},rh;function Ub(){return rh||(rh=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 y=new Array(arguments.length-1),h=0;h<y.length;h++)y[h]=arguments[h+1];var m={callback:k,args:y};return r[t]=m,o(t),t++}function c(k){delete r[k]}function l(k){var y=k.callback,h=k.args;switch(h.length){case 0:y();break;case 1:y(h[0]);break;case 2:y(h[0],h[1]);break;case 3:y(h[0],h[1],h[2]);break;default:y.apply(e,h);break}}function d(k){if(n)setTimeout(d,0,k);else{var y=r[k];if(y){n=!0;try{l(y)}finally{c(k),n=!1}}}}function u(){o=function(k){process.nextTick(function(){d(k)})}}function p(){if(i.postMessage&&!i.importScripts){var k=!0,y=i.onmessage;return i.onmessage=function(){k=!1},i.postMessage("","*"),i.onmessage=y,k}}function g(){var k="setImmediate$"+Math.random()+"$",y=function(h){h.source===i&&typeof h.data=="string"&&h.data.indexOf(k)===0&&d(+h.data.slice(k.length))};i.addEventListener?i.addEventListener("message",y,!1):i.attachEvent("onmessage",y),o=function(h){i.postMessage(k+h,"*")}}function v(){var k=new MessageChannel;k.port1.onmessage=function(y){var h=y.data;d(h)},o=function(y){k.port2.postMessage(y)}}function _(){var k=s.documentElement;o=function(y){var h=s.createElement("script");h.onreadystatechange=function(){d(y),h.onreadystatechange=null,k.removeChild(h),h=null},k.appendChild(h)}}function E(){o=function(k){setTimeout(d,0,k)}}var x=Object.getPrototypeOf&&Object.getPrototypeOf(i);x=x&&x.setTimeout?x:i,{}.toString.call(i.process)==="[object process]"?u():p()?g():i.MessageChannel?v():s&&"onreadystatechange"in s.createElement("script")?_():E(),x.setImmediate=a,x.clearImmediate=c}(typeof self>"u"?typeof cn>"u"?Ba:cn:self)),Ba}/*!
282
307
  * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
283
- */var ua,yu;function mo(){if(yu)return ua;yu=1,Xg();const i=self.crypto||self.msCrypto;return ua=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}},ua}/*!
308
+ */var qa,nh;function Wo(){if(nh)return qa;nh=1,Ub();const i=self.crypto||self.msCrypto;return qa=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}},qa}/*!
284
309
  * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
285
- */var ha,bu;function Vf(){return bu||(bu=1,ha=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}}),ha}/*!
310
+ */var Ua,sh;function Ap(){return sh||(sh=1,Ua=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 c=e[a],l=t.get(c);(n===null||c>n)&&(l&&a>0&&c>e[a-1]||!l&&a<o-1&&c>e[a+1])&&(n=c,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 c of e)c>n&&t.set(c,!t.get(c))}return r}}),Ua}/*!
286
311
  * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
287
- */var fa,vu;function kc(){if(vu)return fa;vu=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+$+"$")})(),fa=class Bs{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=Bs.legacyDatasetToQuads(b));const _=[];for(const E of b)_.push(Bs.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+=` .
288
- `,k}static serializeQuad(b){return Bs.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`
289
- `: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`
290
- `;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 fa}/*!
312
+ */var Va,oh;function ed(){if(oh)return Va;oh=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 g="(?:<([^:]+:[^>]*)>)",_="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�"+"_",E=_+"0-9-·̀-ͯ‿-⁀",k="(_:(?:["+_+"0-9])(?:(?:["+E+".])*(?:["+E+"]))?)",y='"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"',h="(?:\\^\\^"+g+")",T="(?:"+y+"(?:"+h+"|"+"(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))"+")?)",N="[ \\t]+",C="[ \\t]*",F="(?:"+g+"|"+k+")"+N,I=g+N,O="(?:"+g+"|"+k+"|"+T+")"+C,U="(?:\\.|(?:(?:"+g+"|"+k+")"+C+"\\.))";a.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,a.empty=new RegExp("^"+C+"$"),a.quad=new RegExp("^"+C+F+I+O+U+C+"$")})(),Va=class bo{static parse(v){const _=[],E={},x=v.split(a.eoln);let k=0;for(const y of x){if(k++,a.empty.test(y))continue;const h=y.match(a.quad);if(h===null)throw new Error("N-Quads parse error on line "+k+".");const m={subject:null,predicate:null,object:null,graph:null};if(h[1]!==void 0?m.subject={termType:r,value:h[1]}:m.subject={termType:n,value:h[2]},m.predicate={termType:r,value:h[3]},h[4]!==void 0?m.object={termType:r,value:h[4]}:h[5]!==void 0?m.object={termType:n,value:h[5]}:(m.object={termType:s,value:void 0,datatype:{termType:r}},h[7]!==void 0?m.object.datatype.value=h[7]:h[8]!==void 0?(m.object.datatype.value=e,m.object.language=h[8]):m.object.datatype.value=t,m.object.value=p(h[6])),h[9]!==void 0?m.graph={termType:r,value:h[9]}:h[10]!==void 0?m.graph={termType:n,value:h[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 C of N)if(c(C,m)){T=!1;break}T&&(N.push(m),_.push(m))}}return _}static serialize(v){Array.isArray(v)||(v=bo.legacyDatasetToQuads(v));const _=[];for(const E of v)_.push(bo.serializeQuad(E));return _.sort().join("")}static serializeQuadComponents(v,_,E,x){let k="";return v.termType===r?k+=`<${v.value}>`:k+=`${v.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}>`)),x.termType===r?k+=` <${x.value}>`:x.termType===n&&(k+=` ${x.value}`),k+=` .
313
+ `,k}static serializeQuad(v){return bo.serializeQuadComponents(v.subject,v.predicate,v.object,v.graph)}static legacyDatasetToQuads(v){const _=[],E={"blank node":n,IRI:r,literal:s};for(const x in v)v[x].forEach(y=>{const h={};for(const m in y){const T=y[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)),h[m]=N}x==="@default"?h.graph={termType:o,value:""}:h.graph={termType:x.startsWith("_:")?n:r,value:x},_.push(h)});return _}};function c(g,v){return!(g.subject.termType===v.subject.termType&&g.object.termType===v.object.termType)||!(g.subject.value===v.subject.value&&g.predicate.value===v.predicate.value&&g.object.value===v.object.value)?!1:g.object.termType!==s?!0:g.object.datatype.termType===v.object.datatype.termType&&g.object.language===v.object.language&&g.object.datatype.value===v.object.datatype.value}const l=/["\\\n\r]/g;function d(g){return g.replace(l,function(v){switch(v){case'"':return'\\"';case"\\":return"\\\\";case`
314
+ `:return"\\n";case"\r":return"\\r"}})}const u=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function p(g){return g.replace(u,function(v,_,E,x){if(_)switch(_){case"t":return" ";case"b":return"\b";case"n":return`
315
+ `;case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(E)return String.fromCharCode(parseInt(E,16));if(x)throw new Error("Unsupported U escape")})}return Va}/*!
291
316
  * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
292
- */var pa,wu;function zf(){if(wu)return pa;wu=1;const i=Sc(),e=mo(),t=Vf(),r=kc();pa=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 pa}/*!
317
+ */var za,ah;function Np(){if(ah)return za;ah=1;const i=Zc(),e=Wo(),t=Ap(),r=ed();za=class{constructor({createMessageDigest:o=()=>new e("sha256"),canonicalIdMap:a=new Map,maxDeepIterations:c=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n",a),this.createMessageDigest=o,this.maxDeepIterations=c,this.quads=null,this.deepIterations=null}async 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,c=[...this.blankNodeInfo.keys()];let l=0;for(const g of c)++l%100===0&&await this._yield(),await this._hashAndTrackBlankNode({id:g,hashToBlankNodes:a});const d=[...a.keys()].sort(),u=[];for(const g of d){const v=a.get(g);if(v.length>1){u.push(v);continue}const _=v[0];this.canonicalIssuer.getId(_)}for(const g of u){const v=[];for(const _ of g){if(this.canonicalIssuer.hasId(_))continue;const E=new i("_:b");E.getId(_);const x=await this.hashNDegreeQuads(_,E);v.push(x)}v.sort(n);for(const _ of v){const E=_.issuer.getOldIds();for(const x of E)this.canonicalIssuer.getId(x)}}const p=[];for(const g of this.quads){const v=r.serializeQuadComponents(this._componentWithCanonicalId(g.subject),g.predicate,this._componentWithCanonicalId(g.object),this._componentWithCanonicalId(g.graph));p.push(v)}return p.sort(),p.join("")}async hashFirstDegreeQuads(o){const a=[],c=this.blankNodeInfo.get(o),l=c.quads;for(const u of l){const p={subject:null,predicate:u.predicate,object:null,graph:null};p.subject=this.modifyFirstDegreeComponent(o,u.subject,"subject"),p.object=this.modifyFirstDegreeComponent(o,u.object,"object"),p.graph=this.modifyFirstDegreeComponent(o,u.graph,"graph"),a.push(r.serializeQuad(p))}a.sort();const d=this.createMessageDigest();for(const u of a)d.update(u);return c.hash=await d.digest(),c.hash}async hashRelatedBlankNode(o,a,c,l){let d;this.canonicalIssuer.hasId(o)?d=this.canonicalIssuer.getId(o):c.hasId(o)?d=c.getId(o):d=this.blankNodeInfo.get(o).hash;const u=this.createMessageDigest();return u.update(l),l!=="g"&&u.update(this.getRelatedPredicate(a)),u.update(d),u.digest()}async hashNDegreeQuads(o,a){const c=this.deepIterations.get(o)||0;if(c>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(o,c+1);const l=this.createMessageDigest(),d=await this.createHashToRelated(o,a),u=[...d.keys()].sort();for(const p of u){l.update(p);let g="",v;const _=new t(d.get(p));let E=0;for(;_.hasNext();){const x=_.next();++E%3===0&&await this._yield();let k=a.clone(),y="";const h=[];let m=!1;for(const T of x)if(this.canonicalIssuer.hasId(T)?y+=this.canonicalIssuer.getId(T):(k.hasId(T)||h.push(T),y+=k.getId(T)),g.length!==0&&y>g){m=!0;break}if(!m){for(const T of h){const N=await this.hashNDegreeQuads(T,k);if(y+=k.getId(T),y+=`<${N.hash}>`,k=N.issuer,g.length!==0&&y>g){m=!0;break}}m||(g.length===0||y<g)&&(g=y,v=k)}}l.update(g),a=v}return{hash:await l.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 c=new Map,l=this.blankNodeInfo.get(o).quads;let d=0;for(const u of l)++d%100===0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:u,component:u.subject,position:"s",id:o,issuer:a,hashToRelated:c}),this._addRelatedBlankNodeHash({quad:u,component:u.object,position:"o",id:o,issuer:a,hashToRelated:c}),this._addRelatedBlankNodeHash({quad:u,component:u.graph,position:"g",id:o,issuer:a,hashToRelated:c})]);return c}async _hashAndTrackBlankNode({id:o,hashToBlankNodes:a}){const c=await this.hashFirstDegreeQuads(o),l=a.get(c);l?l.push(o):a.set(c,[o])}_addBlankNodeQuadInfo({quad:o,component:a}){if(a.termType!=="BlankNode")return;const c=a.value,l=this.blankNodeInfo.get(c);l?l.quads.add(o):this.blankNodeInfo.set(c,{quads:new Set([o]),hash:null})}async _addRelatedBlankNodeHash({quad:o,component:a,position:c,id:l,issuer:d,hashToRelated:u}){if(!(a.termType==="BlankNode"&&a.value!==l))return;const p=a.value,g=await this.hashRelatedBlankNode(p,o,d,c),v=u.get(g);v?v.push(p):u.set(g,[p])}_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 za}/*!
293
318
  * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
294
- */var ma,_u;function Yg(){if(_u)return ma;_u=1;const i=mo(),e=zf();return ma=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}},ma}/*!
319
+ */var Ha,lh;function Vb(){if(lh)return Ha;lh=1;const i=Wo(),e=Np();return Ha=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 c of o){let l,d;if(c.subject.termType==="BlankNode"&&c.subject.value!==r)d=c.subject.value,l="p";else if(c.object.termType==="BlankNode"&&c.object.value!==r)d=c.object.value,l="r";else continue;++a%100===0&&await this._yield();const u=await this.hashRelatedBlankNode(d,c,n,l),p=s.get(u);p?p.push(d):s.set(u,[d])}return s}},Ha}/*!
295
320
  * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
296
- */var ga,xu;function Hf(){if(xu)return ga;xu=1;const i=Sc(),e=mo(),t=Vf(),r=kc();ga=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 ga}/*!
321
+ */var Wa,ch;function Dp(){if(ch)return Wa;ch=1;const i=Zc(),e=Wo(),t=Ap(),r=ed();Wa=class{constructor({createMessageDigest:o=()=>new e("sha256"),canonicalIdMap:a=new Map,maxDeepIterations:c=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n",a),this.createMessageDigest=o,this.maxDeepIterations=c,this.quads=null,this.deepIterations=null}main(o){this.deepIterations=new Map,this.quads=o;for(const p of o)this._addBlankNodeQuadInfo({quad:p,component:p.subject}),this._addBlankNodeQuadInfo({quad:p,component:p.object}),this._addBlankNodeQuadInfo({quad:p,component:p.graph});const a=new Map,c=[...this.blankNodeInfo.keys()];for(const p of c)this._hashAndTrackBlankNode({id:p,hashToBlankNodes:a});const l=[...a.keys()].sort(),d=[];for(const p of l){const g=a.get(p);if(g.length>1){d.push(g);continue}const v=g[0];this.canonicalIssuer.getId(v)}for(const p of d){const g=[];for(const v of p){if(this.canonicalIssuer.hasId(v))continue;const _=new i("_:b");_.getId(v);const E=this.hashNDegreeQuads(v,_);g.push(E)}g.sort(n);for(const v of g){const _=v.issuer.getOldIds();for(const E of _)this.canonicalIssuer.getId(E)}}const u=[];for(const p of this.quads){const g=r.serializeQuadComponents(this._componentWithCanonicalId({component:p.subject}),p.predicate,this._componentWithCanonicalId({component:p.object}),this._componentWithCanonicalId({component:p.graph}));u.push(g)}return u.sort(),u.join("")}hashFirstDegreeQuads(o){const a=[],c=this.blankNodeInfo.get(o),l=c.quads;for(const u of l){const p={subject:null,predicate:u.predicate,object:null,graph:null};p.subject=this.modifyFirstDegreeComponent(o,u.subject,"subject"),p.object=this.modifyFirstDegreeComponent(o,u.object,"object"),p.graph=this.modifyFirstDegreeComponent(o,u.graph,"graph"),a.push(r.serializeQuad(p))}a.sort();const d=this.createMessageDigest();for(const u of a)d.update(u);return c.hash=d.digest(),c.hash}hashRelatedBlankNode(o,a,c,l){let d;this.canonicalIssuer.hasId(o)?d=this.canonicalIssuer.getId(o):c.hasId(o)?d=c.getId(o):d=this.blankNodeInfo.get(o).hash;const u=this.createMessageDigest();return u.update(l),l!=="g"&&u.update(this.getRelatedPredicate(a)),u.update(d),u.digest()}hashNDegreeQuads(o,a){const c=this.deepIterations.get(o)||0;if(c>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(o,c+1);const l=this.createMessageDigest(),d=this.createHashToRelated(o,a),u=[...d.keys()].sort();for(const p of u){l.update(p);let g="",v;const _=new t(d.get(p));for(;_.hasNext();){const E=_.next();let x=a.clone(),k="";const y=[];let h=!1;for(const m of E)if(this.canonicalIssuer.hasId(m)?k+=this.canonicalIssuer.getId(m):(x.hasId(m)||y.push(m),k+=x.getId(m)),g.length!==0&&k>g){h=!0;break}if(!h){for(const m of y){const T=this.hashNDegreeQuads(m,x);if(k+=x.getId(m),k+=`<${T.hash}>`,x=T.issuer,g.length!==0&&k>g){h=!0;break}}h||(g.length===0||k<g)&&(g=k,v=x)}}l.update(g),a=v}return{hash:l.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 c=new Map,l=this.blankNodeInfo.get(o).quads;for(const d of l)this._addRelatedBlankNodeHash({quad:d,component:d.subject,position:"s",id:o,issuer:a,hashToRelated:c}),this._addRelatedBlankNodeHash({quad:d,component:d.object,position:"o",id:o,issuer:a,hashToRelated:c}),this._addRelatedBlankNodeHash({quad:d,component:d.graph,position:"g",id:o,issuer:a,hashToRelated:c});return c}_hashAndTrackBlankNode({id:o,hashToBlankNodes:a}){const c=this.hashFirstDegreeQuads(o),l=a.get(c);l?l.push(o):a.set(c,[o])}_addBlankNodeQuadInfo({quad:o,component:a}){if(a.termType!=="BlankNode")return;const c=a.value,l=this.blankNodeInfo.get(c);l?l.quads.add(o):this.blankNodeInfo.set(c,{quads:new Set([o]),hash:null})}_addRelatedBlankNodeHash({quad:o,component:a,position:c,id:l,issuer:d,hashToRelated:u}){if(!(a.termType==="BlankNode"&&a.value!==l))return;const p=a.value,g=this.hashRelatedBlankNode(p,o,d,c),v=u.get(g);v?v.push(p):u.set(g,[p])}_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 Wa}/*!
297
322
  * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.
298
- */var ya,Eu;function Zg(){if(Eu)return ya;Eu=1;const i=mo(),e=Hf();return ya=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}},ya}const ey={},ty=Object.freeze(Object.defineProperty({__proto__:null,default:ey},Symbol.toStringTag,{value:"Module"})),iy=Jp(ty);var Su;function ry(){return Su||(Su=1,function(i){const e=zf(),t=Yg(),r=Hf(),n=Zg();let s;try{s=iy}catch{}function o(a){return Array.isArray(a)?a:i.NQuads.legacyDatasetToQuads(a)}i.NQuads=kc(),i.IdentifierIssuer=Sc(),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.")}}(la)),la}var ba,ku;function Ic(){return ku||(ku=1,ba=ry()),ba}var va,Iu;function ri(){if(Iu)return va;Iu=1;const i={};return va=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",va}var wa,Ru;function Gi(){if(Ru)return wa;Ru=1;const i=ri(),e={};return wa=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},wa}var _a,Tu;function hi(){return Tu||(Tu=1,_a=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}}),_a}var xa,$u;function li(){if($u)return xa;$u=1;const i=Gi(),e=ri(),t=Ic().IdentifierIssuer,r=hi(),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={};xa=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 xa}var Ea,Cu;function Rc(){if(Cu)return Ea;Cu=1;const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",e="http://www.w3.org/2001/XMLSchema#";return Ea={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"},Ea}var Sa,Au;function Wf(){return Au||(Au=1,Sa=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]}}}),Sa}var ka,Nu;function or(){if(Nu)return ka;Nu=1;const i=ri(),e={};ka=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),ka}var Ia,Lu;function ny(){if(Lu)return Ia;Lu=1;const{parseLinkHeader:i,buildHeaders:e}=li(),{LINK_HEADER_CONTEXT:t}=Rc(),r=hi(),n=Wf(),{prependBase:s}=or(),o=/(^|(\r\n))link:/i;Ia=({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 Ia}var Ra,Du;function sy(){if(Du)return Ra;Du=1;const i=ny(),e={};return Ra=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})},Ra}var Ta,Ou;function oy(){return Ou||(Ou=1,Ta=function(i){i.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Ta}var $a,Mu;function ay(){if(Mu)return $a;Mu=1,$a=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{oy()(i)}catch{}return $a}var Ca,Pu;function Gf(){if(Pu)return Ca;Pu=1;const i=ay(),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 Ca=g,Ca}var Aa,ju;function ly(){if(ju)return Aa;ju=1;const i=Gf(),e=10;return Aa=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)}},Aa}var Na,Bu;function cy(){if(Bu)return Na;Bu=1;const{isArray:i,isObject:e,isString:t}=ri(),{asArray:r}=li(),{prependBase:n}=or(),s=hi(),o=ly(),a=10;Na=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 Na}var La,Fu;function dy(){return Fu||(Fu=1,La=Ic().NQuads),La}var Da,qu;function fs(){if(qu)return Da;qu=1;const i=hi(),{isArray:e}=ri(),{asArray:t}=li(),r={};Da=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},Da}var Oa,Uu;function kr(){if(Uu)return Oa;Uu=1;const i=li(),e=hi(),{isArray:t,isObject:r,isString:n,isUndefined:s}=ri(),{isAbsolute:o,isRelative:a,prependBase:l}=or(),{handleEvent:c}=fs(),{REGEX_BCP47:d,REGEX_KEYWORD:f,asArray:g,compareShortestLeast:y}=li(),b=new Map,_=1e4,E={};Oa=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:X,next:A})=>{R.push(X),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 X of I){let{document:A}=X;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=X.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})}}X.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
299
- const X=q["@id"];if(X==="@context"||X==="@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={},X={},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&&X[ce].push(x);else if(I[ce]=H={},!W&&!z._termHasColon){X[ce]=[x];const K={iri:ce,terms:X[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 X=q[I],A=q[I]={};let Y,F;for(const te of X)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 Oa}var Ma,Vu;function uy(){if(Vu)return Ma;Vu=1;const i=hi(),{isArray:e,isObject:t,isEmptyObject:r,isString:n,isUndefined:s}=ri(),{isList:o,isValue:a,isGraph:l,isSubject:c}=Gi(),{expandIri:d,getContextValue:f,isKeyword:g,process:y,processingMode:b}=kr(),{isAbsolute:_}=or(),{REGEX_BCP47:E,REGEX_KEYWORD:S,addValue:k,asArray:v,getValues:u,validateTypeValue:m}=li(),{handleEvent:T}=fs(),N={};Ma=N,N.expand=async({activeCtx:I,activeProperty:L=null,element:X,options:A={},insideList:Y=!1,insideIndex:F=!1,typeScopedContext:te=null})=>{if(X==null)return null;if(L==="@default"&&(A=Object.assign({},A,{isFrame:!1})),!e(X)&&!t(X))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:X}},options:A}),null):R({activeCtx:I,activeProperty:L,value:X,options:A});if(e(X)){let K=[];const V=f(I,L,"@container")||[];Y=Y||V.includes("@list");for(let re=0;re<X.length;++re){let ne=await N.expand({activeCtx:I,activeProperty:L,element:X[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(X).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 X&&(I=await y({activeCtx:I,localCtx:X["@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=X[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:X,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:X}){if(L===0||"@value"in I||"@list"in I||L===1&&"@id"in I){if(X.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:X})}return null}return I}async function j({activeCtx:I,activeProperty:L,expandedActiveProperty:X,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(X==="@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&&X==="@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:X,element:V,expandedParent:Y,options:F,insideList:te,typeScopedContext:z,typeKey:x})}}}function R({activeCtx:I,activeProperty:L,value:X,options:A}){if(X==null)return null;const Y=d(I,L,{vocab:!0},A);if(Y==="@id")return d(I,X,{base:!0},A);if(Y==="@type")return d(I,X,{vocab:!0,base:!0},{...A,typeExpansion:!0});const F=f(I,L,"@type");if((F==="@id"||Y==="@graph")&&n(X)){const x=d(I,X,{base:!0},A);return x===null&&X.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(X))return{"@id":d(I,X,{vocab:!0,base:!0},A)};if(g(Y))return X;const te={};if(F&&!["@id","@vocab","@none"].includes(F))te["@type"]=F;else if(n(X)){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 X)||(X=X.toString()),te["@value"]=X,te}function P(I,L,X,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()),X&&(J["@direction"]=X),Y.push(J)}}return Y}async function q({activeCtx:I,options:L,activeProperty:X,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:X,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 Ma}var Pa,zu;function go(){if(zu)return Pa;zu=1;const{isKeyword:i}=kr(),e=Gi(),t=ri(),r=li(),n=hi(),s={};return Pa=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},Pa}var ja,Hu;function hy(){if(Hu)return ja;Hu=1;const{isSubjectReference:i}=Gi(),{createMergedNodeMap:e}=go(),t={};return ja=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},ja}var Ba,Wu;function fy(){if(Wu)return Ba;Wu=1;const i=hi(),e=Gi(),t=ri(),{REGEX_BCP47:r,addValue:n}=li(),{handleEvent:s}=fs(),{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:_}=Rc(),E={};Ba=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],X=q.subject.value,A=q.predicate.value,Y=q.object;X in L||(L[X]={"@id":X});const F=L[X],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 X of L.usages){let A=X.node,Y=X.property,F=X.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"]),X=j[A["@id"]],A=X.node,Y=X.property,F=X.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"]=[],X=$[q],A=Object.keys(X).sort();for(const Y of A){const F=X[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 Ba}var Fa,Gu;function py(){return Gu||(Gu=1,Fa=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])},"")+"}"}),Fa}var qa,Ku;function my(){if(Ku)return qa;Ku=1;const{createNodeMap:i}=go(),{isKeyword:e}=kr(),t=Gi(),r=py(),n=hi(),s=ri(),o=li(),{handleEvent:a}=fs(),{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}=Rc(),{isAbsolute:k}=or(),v={};qa=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],X=Object.keys(L).sort();for(let A of X){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},X={termType:"NamedNode",value:d},A=N.pop(),Y=A?{termType:"BlankNode",value:$.getId()}:X;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:X,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 X=N["@type"]||null;if(X==="@json")I.value=r(L),I.datatype.value=g;else if(s.isBoolean(L))I.value=L.toString(),I.datatype.value=X||b;else if(s.isDouble(L)||X===_)s.isDouble(L)||(L=parseFloat(L)),I.value=L.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),I.datatype.value=X||_;else if(s.isNumber(L))I.value=L.toFixed(0),I.datatype.value=X||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=X||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=X||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 qa}var Ua,Ju;function gy(){if(Ju)return Ua;Ju=1;const{isKeyword:i}=kr(),e=Gi(),t=ri(),r=li(),n=or(),s=hi(),{createNodeMap:o,mergeNodeMapGraphs:a}=go(),l={};Ua=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
300
- 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 X=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(X,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:X,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(X).sort()){if(i(Y)){if(A[Y]=r.clone(X[Y]),Y==="@type")for(const F of X["@type"])F.indexOf("_:")===0&&r.addValue(u.bnodeMap,F,A,{propertyIsArray:!0});continue}if(!(R.explicit&&!(Y in T)))for(const F of X[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(X=>X===L);if(!N.requireAll)return P}else{if(i(R))continue;{const L=r.getValues(T,R)[0];let X=!1;if(L&&(g([L]),X="@default"in L),$=!1,q.length===0&&X)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)}/**
323
+ */var Ga,dh;function zb(){if(dh)return Ga;dh=1;const i=Wo(),e=Dp();return Ga=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 c,l;if(a.subject.termType==="BlankNode"&&a.subject.value!==r)l=a.subject.value,c="p";else if(a.object.termType==="BlankNode"&&a.object.value!==r)l=a.object.value,c="r";else continue;const d=this.hashRelatedBlankNode(l,a,n,c),u=s.get(d);u?u.push(l):s.set(d,[l])}return s}},Ga}const Hb={},Wb=Object.freeze(Object.defineProperty({__proto__:null,default:Hb},Symbol.toStringTag,{value:"Module"})),Gb=Cm(Wb);var uh;function Kb(){return uh||(uh=1,function(i){const e=Np(),t=Vb(),r=Dp(),n=zb();let s;try{s=Gb}catch{}function o(a){return Array.isArray(a)?a:i.NQuads.legacyDatasetToQuads(a)}i.NQuads=ed(),i.IdentifierIssuer=Zc(),i._rdfCanonizeNative=function(a){return a&&(s=a),s},i.canonize=async function(a,c){const l=o(a);if(c.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(c.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((d,u)=>s.canonize(l,c,(p,g)=>p?u(p):d(g)))}if(c.algorithm==="URDNA2015")return new e(c).main(l);if(c.algorithm==="URGNA2012"){if(c.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new t(c).main(l)}throw"algorithm"in c?new Error("Invalid RDF Dataset Canonicalization algorithm: "+c.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")},i._canonizeSync=function(a,c){const l=o(a);if(c.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(c.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return s.canonizeSync(l,c)}if(c.algorithm==="URDNA2015")return new r(c).main(l);if(c.algorithm==="URGNA2012"){if(c.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new n(c).main(l)}throw"algorithm"in c?new Error("Invalid RDF Dataset Canonicalization algorithm: "+c.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}}(Fa)),Fa}var Ka,hh;function td(){return hh||(hh=1,Ka=Kb()),Ka}var Xa,fh;function mi(){if(fh)return Xa;fh=1;const i={};return Xa=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",Xa}var Ja,ph;function ar(){if(ph)return Ja;ph=1;const i=mi(),e={};return Ja=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},Ja}var Qa,mh;function Ei(){return mh||(mh=1,Qa=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}}),Qa}var Ya,gh;function vi(){if(gh)return Ya;gh=1;const i=ar(),e=mi(),t=td().IdentifierIssuer,r=Ei(),n=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,o=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,a=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,c=/^@[a-zA-Z]+$/,l={headers:{accept:"application/ld+json, application/json"}},d={};Ya=d,d.IdentifierIssuer=t,d.REGEX_BCP47=n,d.REGEX_KEYWORD=c,d.clone=function(p){if(p&&typeof p=="object"){let g;if(e.isArray(p)){g=[];for(let v=0;v<p.length;++v)g[v]=d.clone(p[v])}else if(p instanceof Map){g=new Map;for(const[v,_]of p)g.set(v,d.clone(_))}else if(p instanceof Set){g=new Set;for(const v of p)g.add(d.clone(v))}else if(e.isObject(p)){g={};for(const v in p)g[v]=d.clone(p[v])}else g=p.toString();return g}return p},d.asArray=function(p){return Array.isArray(p)?p:[p]},d.buildHeaders=(p={})=>{if(Object.keys(p).some(v=>v.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+l.headers.accept+'" is supported.');return Object.assign({Accept:l.headers.accept},p)},d.parseLinkHeader=p=>{const g={},v=p.match(s);for(let _=0;_<v.length;++_){let E=v[_].match(o);if(!E)continue;const x={target:E[1]},k=E[2];for(;E=a.exec(k);)x[E[1]]=E[2]===void 0?E[3]:E[2];const y=x.rel||"";Array.isArray(g[y])?g[y].push(x):g.hasOwnProperty(y)?g[y]=[g[y],x]:g[y]=x}return g},d.validateTypeValue=(p,g)=>{if(!e.isString(p)&&!(e.isArray(p)&&p.every(v=>e.isString(v)))){if(g&&e.isObject(p))switch(Object.keys(p).length){case 0:return;case 1:if("@default"in p&&d.asArray(p["@default"]).every(v=>e.isString(v)))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:p})}},d.hasProperty=(p,g)=>{if(p.hasOwnProperty(g)){const v=p[g];return!e.isArray(v)||v.length>0}return!1},d.hasValue=(p,g,v)=>{if(d.hasProperty(p,g)){let _=p[g];const E=i.isList(_);if(e.isArray(_)||E){E&&(_=_["@list"]);for(let x=0;x<_.length;++x)if(d.compareValues(v,_[x]))return!0}else if(!e.isArray(v))return d.compareValues(v,_)}return!1},d.addValue=(p,g,v,_)=>{if(_=_||{},"propertyIsArray"in _||(_.propertyIsArray=!1),"valueIsArray"in _||(_.valueIsArray=!1),"allowDuplicate"in _||(_.allowDuplicate=!0),"prependValue"in _||(_.prependValue=!1),_.valueIsArray)p[g]=v;else if(e.isArray(v)){v.length===0&&_.propertyIsArray&&!p.hasOwnProperty(g)&&(p[g]=[]),_.prependValue&&(v=v.concat(p[g]),p[g]=[]);for(let E=0;E<v.length;++E)d.addValue(p,g,v[E],_)}else if(p.hasOwnProperty(g)){const E=!_.allowDuplicate&&d.hasValue(p,g,v);!e.isArray(p[g])&&(!E||_.propertyIsArray)&&(p[g]=[p[g]]),E||(_.prependValue?p[g].unshift(v):p[g].push(v))}else p[g]=_.propertyIsArray?[v]:v},d.getValues=(p,g)=>[].concat(p[g]||[]),d.removeProperty=(p,g)=>{delete p[g]},d.removeValue=(p,g,v,_)=>{_=_||{},"propertyIsArray"in _||(_.propertyIsArray=!1);const E=d.getValues(p,g).filter(x=>!d.compareValues(x,v));E.length===0?d.removeProperty(p,g):E.length===1&&!_.propertyIsArray?p[g]=E[0]:p[g]=E},d.relabelBlankNodes=(p,g)=>{g=g||{};const v=g.issuer||new t("_:b");return u(v,p)},d.compareValues=(p,g)=>p===g||i.isValue(p)&&i.isValue(g)&&p["@value"]===g["@value"]&&p["@type"]===g["@type"]&&p["@language"]===g["@language"]&&p["@index"]===g["@index"]?!0:e.isObject(p)&&"@id"in p&&e.isObject(g)&&"@id"in g?p["@id"]===g["@id"]:!1,d.compareShortestLeast=(p,g)=>p.length<g.length?-1:g.length<p.length?1:p===g?0:p<g?-1:1;function u(p,g){if(e.isArray(g))for(let v=0;v<g.length;++v)g[v]=u(p,g[v]);else if(i.isList(g))g["@list"]=u(p,g["@list"]);else if(e.isObject(g)){i.isBlankNode(g)&&(g["@id"]=p.getId(g["@id"]));const v=Object.keys(g).sort();for(let _=0;_<v.length;++_){const E=v[_];E!=="@id"&&(g[E]=u(p,g[E]))}}return g}return Ya}var Za,bh;function id(){if(bh)return Za;bh=1;const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",e="http://www.w3.org/2001/XMLSchema#";return Za={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"},Za}var el,yh;function Lp(){return yh||(yh=1,el=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]}}}),el}var tl,vh;function xr(){if(vh)return tl;vh=1;const i=mi(),e={};tl=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 c=o.keys.length;for(;c--;)s[o.keys[c]]=a[c]===void 0?null:a[c];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 c=r.path;c=c.substr(0,c.lastIndexOf("/")+1),(c.length>0||r.authority)&&c.substr(-1)!=="/"&&(c+="/"),c+=s.path,o.path=c}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("/"),c=o.normalizedPath.split("/"),l=o.fragment||o.query?0:1;for(;a.length>0&&c.length>l&&a[0]===c[0];)a.shift(),c.shift();let d="";if(a.length>0){a.pop();for(let u=0;u<a.length;++u)d+="../"}return d+=c.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),tl}var il,wh;function Xb(){if(wh)return il;wh=1;const{parseLinkHeader:i,buildHeaders:e}=vi(),{LINK_HEADER_CONTEXT:t}=id(),r=Ei(),n=Lp(),{prependBase:s}=xr(),o=/(^|(\r\n))link:/i;il=({secure:c,headers:l={},xhr:d}={headers:{}})=>{return l=e(l),new n().wrapLoader(p);async function p(g){if(g.indexOf("http:")!==0&&g.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:g});if(c&&g.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:g});let v;try{v=await a(d,g,l)}catch(y){throw new r("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:g,cause:y})}if(v.status>=400)throw new r("URL could not be dereferenced: "+v.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:g,httpStatusCode:v.status});let _={contextUrl:null,documentUrl:g,document:v.response},E=null;const x=v.getResponseHeader("Content-Type");let k;if(o.test(v.getAllResponseHeaders())&&(k=v.getResponseHeader("Link")),k&&x!=="application/ld+json"){const y=i(k),h=y[t];if(Array.isArray(h))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:g});h&&(_.contextUrl=h.target),E=y.alternate,E&&E.type=="application/ld+json"&&!(x||"").match(/^application\/(\w*\+)?json$/)&&(_=await p(s(g,E.target)))}return _}};function a(c,l,d){c=c||XMLHttpRequest;const u=new c;return new Promise((p,g)=>{u.onload=()=>p(u),u.onerror=v=>g(v),u.open("GET",l,!0);for(const v in d)u.setRequestHeader(v,d[v]);u.send()})}return il}var rl,_h;function Jb(){if(_h)return rl;_h=1;const i=Xb(),e={};return rl=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})},rl}var nl,xh;function Qb(){return xh||(xh=1,nl=function(i){i.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),nl}var sl,Eh;function Yb(){if(Eh)return sl;Eh=1,sl=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(l){o.push(l)});else if(arguments.length>0)for(var a=0,c=arguments.length;a<c;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,c=0;a!==null;c++)s.call(o,a.value,c,this),a=a.next},i.prototype.forEachReverse=function(s,o){o=o||this;for(var a=this.tail,c=this.length-1;a!==null;c--)s.call(o,a.value,c,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,c=this.head;c!==null;)a.push(s.call(o,c.value,this)),c=c.next;return a},i.prototype.mapReverse=function(s,o){o=o||this;for(var a=new i,c=this.tail;c!==null;)a.push(s.call(o,c.value,this)),c=c.prev;return a},i.prototype.reduce=function(s,o){var a,c=this.head;if(arguments.length>1)a=o;else if(this.head)c=this.head.next,a=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var l=0;c!==null;l++)a=s(a,c.value,l),c=c.next;return a},i.prototype.reduceReverse=function(s,o){var a,c=this.tail;if(arguments.length>1)a=o;else if(this.tail)c=this.tail.prev,a=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var l=this.length-1;c!==null;l--)a=s(a,c.value,l),c=c.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 c=0,l=this.head;l!==null&&c<s;c++)l=l.next;for(;l!==null&&c<o;c++,l=l.next)a.push(l.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 c=this.length,l=this.tail;l!==null&&c>o;c--)l=l.prev;for(;l!==null&&c>s;c--,l=l.prev)a.push(l.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 c=0,l=this.head;l!==null&&c<s;c++)l=l.next;for(var d=[],c=0;l&&c<o;c++)d.push(l.value),l=this.removeNode(l);l===null&&(l=this.tail),l!==this.head&&l!==this.tail&&(l=l.prev);for(var c=0;c<a.length;c++)l=e(this,l,a[c]);return d},i.prototype.reverse=function(){for(var s=this.head,o=this.tail,a=s;a!==null;a=a.prev){var c=a.prev;a.prev=a.next,a.next=c}return this.head=o,this.tail=s,this};function e(s,o,a){var c=o===s.head?new n(a,null,o,s):new n(a,o,o.next,s);return c.next===null&&(s.tail=c),c.prev===null&&(s.head=c),s.length++,c}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,c){if(!(this instanceof n))return new n(s,o,a,c);this.list=c,this.value=s,o?(o.next=this,this.prev=o):this.prev=null,a?(a.prev=this,this.next=a):this.next=null}try{Qb()(i)}catch{}return sl}var ol,Sh;function Op(){if(Sh)return ol;Sh=1;const i=Yb(),e=Symbol("max"),t=Symbol("length"),r=Symbol("lengthCalculator"),n=Symbol("allowStale"),s=Symbol("maxAge"),o=Symbol("dispose"),a=Symbol("noDisposeOnSet"),c=Symbol("lruList"),l=Symbol("cache"),d=Symbol("updateAgeOnGet"),u=()=>1;class p{constructor(h){if(typeof h=="number"&&(h={max:h}),h||(h={}),h.max&&(typeof h.max!="number"||h.max<0))throw new TypeError("max must be a non-negative number");this[e]=h.max||1/0;const m=h.length||u;if(this[r]=typeof m!="function"?u:m,this[n]=h.stale||!1,h.maxAge&&typeof h.maxAge!="number")throw new TypeError("maxAge must be a number");this[s]=h.maxAge||0,this[o]=h.dispose,this[a]=h.noDisposeOnSet||!1,this[d]=h.updateAgeOnGet||!1,this.reset()}set max(h){if(typeof h!="number"||h<0)throw new TypeError("max must be a non-negative number");this[e]=h||1/0,_(this)}get max(){return this[e]}set allowStale(h){this[n]=!!h}get allowStale(){return this[n]}set maxAge(h){if(typeof h!="number")throw new TypeError("maxAge must be a non-negative number");this[s]=h,_(this)}get maxAge(){return this[s]}set lengthCalculator(h){typeof h!="function"&&(h=u),h!==this[r]&&(this[r]=h,this[t]=0,this[c].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[c].length}rforEach(h,m){m=m||this;for(let T=this[c].tail;T!==null;){const N=T.prev;k(this,h,T,m),T=N}}forEach(h,m){m=m||this;for(let T=this[c].head;T!==null;){const N=T.next;k(this,h,T,m),T=N}}keys(){return this[c].toArray().map(h=>h.key)}values(){return this[c].toArray().map(h=>h.value)}reset(){this[o]&&this[c]&&this[c].length&&this[c].forEach(h=>this[o](h.key,h.value)),this[l]=new Map,this[c]=new i,this[t]=0}dump(){return this[c].map(h=>v(this,h)?!1:{k:h.key,v:h.value,e:h.now+(h.maxAge||0)}).toArray().filter(h=>h)}dumpLru(){return this[c]}set(h,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,C=this[r](m,h);if(this[l].has(h)){if(C>this[e])return E(this,this[l].get(h)),!1;const O=this[l].get(h).value;return this[o]&&(this[a]||this[o](h,O.value)),O.now=N,O.maxAge=T,O.value=m,this[t]+=C-O.length,O.length=C,this.get(h),_(this),!0}const F=new x(h,m,C,N,T);return F.length>this[e]?(this[o]&&this[o](h,m),!1):(this[t]+=F.length,this[c].unshift(F),this[l].set(h,this[c].head),_(this),!0)}has(h){if(!this[l].has(h))return!1;const m=this[l].get(h).value;return!v(this,m)}get(h){return g(this,h,!0)}peek(h){return g(this,h,!1)}pop(){const h=this[c].tail;return h?(E(this,h),h.value):null}del(h){E(this,this[l].get(h))}load(h){this.reset();const m=Date.now();for(let T=h.length-1;T>=0;T--){const N=h[T],C=N.e||0;if(C===0)this.set(N.k,N.v);else{const F=C-m;F>0&&this.set(N.k,N.v,F)}}}prune(){this[l].forEach((h,m)=>g(this,m,!1))}}const g=(y,h,m)=>{const T=y[l].get(h);if(T){const N=T.value;if(v(y,N)){if(E(y,T),!y[n])return}else m&&(y[d]&&(T.value.now=Date.now()),y[c].unshiftNode(T));return N.value}},v=(y,h)=>{if(!h||!h.maxAge&&!y[s])return!1;const m=Date.now()-h.now;return h.maxAge?m>h.maxAge:y[s]&&m>y[s]},_=y=>{if(y[t]>y[e])for(let h=y[c].tail;y[t]>y[e]&&h!==null;){const m=h.prev;E(y,h),h=m}},E=(y,h)=>{if(h){const m=h.value;y[o]&&y[o](m.key,m.value),y[t]-=m.length,y[l].delete(m.key),y[c].removeNode(h)}};class x{constructor(h,m,T,N,C){this.key=h,this.value=m,this.length=T,this.now=N,this.maxAge=C||0}}const k=(y,h,m,T)=>{let N=m.value;v(y,N)&&(E(y,m),y[n]||(N=void 0)),N&&h.call(T,N.value,N.key,y)};return ol=p,ol}var al,kh;function Zb(){if(kh)return al;kh=1;const i=Op(),e=10;return al=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)}},al}var ll,Rh;function ey(){if(Rh)return ll;Rh=1;const{isArray:i,isObject:e,isString:t}=mi(),{asArray:r}=vi(),{prependBase:n}=xr(),s=Ei(),o=Zb(),a=10;ll=class{constructor({sharedCache:u}){this.perOpCache=new Map,this.sharedCache=u}async resolve({activeCtx:u,context:p,documentLoader:g,base:v,cycles:_=new Set}){p&&e(p)&&p["@context"]&&(p=p["@context"]),p=r(p);const E=[];for(const x of p){if(t(x)){let h=this._get(x);h||(h=await this._resolveRemoteContext({activeCtx:u,url:x,documentLoader:g,base:v,cycles:_})),i(h)?E.push(...h):E.push(h);continue}if(x===null){E.push(new o({document:null}));continue}e(x)||c(p);const k=JSON.stringify(x);let y=this._get(k);y||(y=new o({document:x}),this._cacheResolvedContext({key:k,resolved:y,tag:"static"})),E.push(y)}return E}_get(u){let p=this.perOpCache.get(u);if(!p){const g=this.sharedCache.get(u);g&&(p=g.get("static"),p&&this.perOpCache.set(u,p))}return p}_cacheResolvedContext({key:u,resolved:p,tag:g}){if(this.perOpCache.set(u,p),g!==void 0){let v=this.sharedCache.get(u);v||(v=new Map,this.sharedCache.set(u,v)),v.set(g,p)}return p}async _resolveRemoteContext({activeCtx:u,url:p,documentLoader:g,base:v,cycles:_}){p=n(v,p);const{context:E,remoteDoc:x}=await this._fetchContext({activeCtx:u,url:p,documentLoader:g,cycles:_});v=x.documentUrl||p,l({context:E,base:v});const k=await this.resolve({activeCtx:u,context:E,documentLoader:g,base:v,cycles:_});return this._cacheResolvedContext({key:p,resolved:k,tag:x.tag}),k}async _fetchContext({activeCtx:u,url:p,documentLoader:g,cycles:v}){if(v.size>a)throw new s("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:u.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:a});if(v.has(p))throw new s("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:u.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:p});v.add(p);let _,E;try{E=await g(p),_=E.document||null,t(_)&&(_=JSON.parse(_))}catch(x){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: "${p}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:p,cause:x})}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: "${p}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:p});return"@context"in _?_={"@context":_["@context"]}:_={"@context":{}},E.contextUrl&&(i(_["@context"])||(_["@context"]=[_["@context"]]),_["@context"].push(E.contextUrl)),{context:_,remoteDoc:E}}};function c(d){throw new s("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:d})}function l({context:d,base:u}){if(!d)return;const p=d["@context"];if(t(p)){d["@context"]=n(u,p);return}if(i(p)){for(let g=0;g<p.length;++g){const v=p[g];if(t(v)){p[g]=n(u,v);continue}e(v)&&l({context:{"@context":v},base:u})}return}if(e(p))for(const g in p)l({context:p[g],base:u})}return ll}var cl,Ih;function ty(){return Ih||(Ih=1,cl=td().NQuads),cl}var dl,Th;function Bs(){if(Th)return dl;Th=1;const i=Ei(),{isArray:e}=mi(),{asArray:t}=vi(),r={};dl=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 c=!0;for(let l=0;c&&l<a.length;++l){c=!1;const d=a[l];if(e(d))c=n({event:o,handlers:d});else if(typeof d=="function")d({event:o,next:()=>{c=!0}});else if(typeof d=="object")o.code in d?d[o.code]({event:o,next:()=>{c=!0}}):c=!0;else throw new i("Invalid event handler.","jsonld.InvalidEventHandler",{event:o})}return c}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:c}){if(a.level==="warning"&&s.has(a.code))throw new i("Safe mode validation error.","jsonld.ValidationError",{event:a});c()},r.logEventHandler=function({event:a,next:c}){console.log(`EVENT: ${a.message}`,{event:a}),c()},r.logWarningEventHandler=function({event:a,next:c}){a.level==="warning"&&console.warn(`WARNING: ${a.message}`,{event:a}),c()},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},dl}var ul,Ch;function Vr(){if(Ch)return ul;Ch=1;const i=vi(),e=Ei(),{isArray:t,isObject:r,isString:n,isUndefined:s}=mi(),{isAbsolute:o,isRelative:a,prependBase:c}=xr(),{handleEvent:l}=Bs(),{REGEX_BCP47:d,REGEX_KEYWORD:u,asArray:p,compareShortestLeast:g}=vi(),v=new Map,_=1e4,E={};ul=E,E.process=async({activeCtx:y,localCtx:h,options:m,propagate:T=!0,overrideProtected:N=!1,cycles:C=new Set})=>{if(r(h)&&"@context"in h&&t(h["@context"])&&(h=h["@context"]),p(h).length===0)return y;const I=[],O=[({event:Q,next:$})=>{I.push(Q),$()}];m.eventHandler&&O.push(m.eventHandler);const U=m;m={...m,eventHandler:O};const R=await m.contextResolver.resolve({activeCtx:y,context:h,documentLoader:m.documentLoader,base:m.base});r(R[0].document)&&typeof R[0].document["@propagate"]=="boolean"&&(T=R[0].document["@propagate"]);let D=y;!T&&!D.previousContext&&(D=D.clone(),D.previousContext=y);for(const Q of R){let{document:$}=Q;if(y=D,$===null){if(!N&&Object.keys(y.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"});D=y=E.getInitialContext(m).clone();continue}const Y=Q.getProcessed(y);if(Y){if(U.eventHandler)for(const re of Y.events)l({event:re,options:U});D=y=Y.context;continue}if(r($)&&"@context"in $&&($=$["@context"]),!r($))throw new e("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:$});D=D.clone();const B=new Map;if("@version"in $){if($["@version"]!==1.1)throw new e("Unsupported JSON-LD version: "+$["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:$});if(y.processingMode&&y.processingMode==="json-ld-1.0")throw new e("@version: "+$["@version"]+" not compatible with "+y.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:$});D.processingMode="json-ld-1.1",D["@version"]=$["@version"],B.set("@version",!0)}if(D.processingMode=D.processingMode||y.processingMode,"@base"in $){let re=$["@base"];if(!(re===null||o(re)))if(a(re))re=c(D["@base"],re);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:$});D["@base"]=re,B.set("@base",!0)}if("@vocab"in $){const re=$["@vocab"];if(re===null)delete D["@vocab"];else if(n(re)){if(!o(re)&&E.processingMode(D,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:$});{const S=x(D,re,{vocab:!0,base:!0},void 0,void 0,m);o(S)||m.eventHandler&&l({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:S}},options:m}),D["@vocab"]=S}}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:$});B.set("@vocab",!0)}if("@language"in $){const re=$["@language"];if(re===null)delete D["@language"];else if(n(re))re.match(d)||m.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:re}},options:m}),D["@language"]=re.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:$});B.set("@language",!0)}if("@direction"in $){const re=$["@direction"];if(y.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @direction not compatible with "+y.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:$});if(re===null)delete D["@direction"];else{if(re!=="ltr"&&re!=="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:$});D["@direction"]=re}B.set("@direction",!0)}if("@propagate"in $){const re=$["@propagate"];if(y.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @propagate not compatible with "+y.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:$});if(typeof re!="boolean")throw new e("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:h});B.set("@propagate",!0)}if("@import"in $){const re=$["@import"];if(y.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @import not compatible with "+y.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:$});if(!n(re))throw new e("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:h});const S=await m.contextResolver.resolve({activeCtx:y,context:re,documentLoader:m.documentLoader,base:m.base});if(S.length!==1)throw new e("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:h});const H=S[0].getProcessed(y);if(H)$=H;else{const ee=S[0].document;if("@import"in ee)throw new e("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:h});for(const J in ee)$.hasOwnProperty(J)||($[J]=ee[J]);S[0].setProcessed(y,$)}B.set("@import",!0)}B.set("@protected",$["@protected"]||!1);for(const re in $)if(E.createTermDefinition({activeCtx:D,localCtx:$,term:re,defined:B,options:m,overrideProtected:N}),r($[re])&&"@context"in $[re]){const S=$[re]["@context"];let H=!0;if(n(S)){const ee=c(m.base,S);C.has(ee)?H=!1:C.add(ee)}if(H)try{await E.process({activeCtx:D.clone(),localCtx:$[re]["@context"],overrideProtected:!0,options:m,cycles:C})}catch{throw new e("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:$[re]["@context"],term:re})}}Q.setProcessed(y,{context:D,events:I})}return D},E.createTermDefinition=({activeCtx:y,localCtx:h,term:m,defined:T,options:N,overrideProtected:C=!1})=>{if(T.has(m)){if(T.get(m))return;throw new e("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:h,term:m})}T.set(m,!1);let F;if(h.hasOwnProperty(m)&&(F=h[m]),m==="@type"&&r(F)&&(F["@container"]||"@set")==="@set"&&E.processingMode(y,1.1)){const $=["@container","@id","@protected"],Y=Object.keys(F);if(Y.length===0||Y.some(B=>!$.includes(B)))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:h,term:m})}else{if(E.isKeyword(m))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:h,term:m});if(m.match(u)){N.eventHandler&&l({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:h})}const I=y.mappings.get(m);y.mappings.has(m)&&y.mappings.delete(m);let O=!1;if((n(F)||F===null)&&(O=!0,F={"@id":F}),!r(F))throw new e("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:h});const U={};y.mappings.set(m,U),U.reverse=!1;const R=["@container","@id","@language","@reverse","@type"];E.processingMode(y,1.1)&&R.push("@context","@direction","@index","@nest","@prefix","@protected");for(const $ in F)if(!R.includes($))throw new e("Invalid JSON-LD syntax; a term definition must not contain "+$,"jsonld.SyntaxError",{code:"invalid term definition",context:h});const D=m.indexOf(":");if(U._termHasColon=D>0,"@reverse"in F){if("@id"in F)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:h});if("@nest"in F)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:h});const $=F["@reverse"];if(!n($))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:h});if($.match(u)){N.eventHandler&&l({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:$}},options:N}),I?y.mappings.set(m,I):y.mappings.delete(m);return}const Y=x(y,$,{vocab:!0,base:!1},h,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:h});U["@id"]=Y,U.reverse=!0}else if("@id"in F){let $=F["@id"];if($&&!n($))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:h});if($===null)U["@id"]=null;else if(!E.isKeyword($)&&$.match(u)){N.eventHandler&&l({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:$}},options:N}),I?y.mappings.set(m,I):y.mappings.delete(m);return}else if($!==m){if($=x(y,$,{vocab:!0,base:!1},h,T,N),!o($)&&!E.isKeyword($))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:h});if(m.match(/(?::[^:])|\//)){const Y=new Map(T).set(m,!0);if(x(y,m,{vocab:!0,base:!1},h,Y,N)!==$)throw new e("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:h})}U["@id"]=$,U._prefix=O&&!U._termHasColon&&$.match(/[:\/\?#\[\]@]$/)!==null}}if(!("@id"in U))if(U._termHasColon){const $=m.substr(0,D);if(h.hasOwnProperty($)&&E.createTermDefinition({activeCtx:y,localCtx:h,term:$,defined:T,options:N}),y.mappings.has($)){const Y=m.substr(D+1);U["@id"]=y.mappings.get($)["@id"]+Y}else U["@id"]=m}else if(m==="@type")U["@id"]=m;else{if(!("@vocab"in y))throw new e("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:h,term:m});U["@id"]=y["@vocab"]+m}if((F["@protected"]===!0||T.get("@protected")===!0&&F["@protected"]!==!1)&&(y.protected[m]=!0,U.protected=!0),T.set(m,!0),"@type"in F){let $=F["@type"];if(!n($))throw new e("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:h});if($==="@json"||$==="@none"){if(E.processingMode(y,1))throw new e(`Invalid JSON-LD syntax; an @context @type value must not be "${$}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:h})}else if($!=="@id"&&$!=="@vocab"){if($=x(y,$,{vocab:!0,base:!1},h,T,N),!o($))throw new e("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:h});if($.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:h})}U["@type"]=$}if("@container"in F){const $=n(F["@container"])?[F["@container"]]:F["@container"]||[],Y=["@list","@set","@index","@language"];let B=!0;const re=$.includes("@set");if(E.processingMode(y,1.1)){if(Y.push("@graph","@id","@type"),$.includes("@list")){if($.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:h})}else if($.includes("@graph")){if($.some(S=>S!=="@graph"&&S!=="@id"&&S!=="@index"&&S!=="@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:h})}else B&=$.length<=(re?2:1);if($.includes("@type")&&(U["@type"]=U["@type"]||"@id",!["@id","@vocab"].includes(U["@type"])))throw new e("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:h})}else B&=!t(F["@container"]),B&=$.length<=1;if(B&=$.every(S=>Y.includes(S)),B&=!(re&&$.includes("@list")),!B)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:h});if(U.reverse&&!$.every(S=>["@index","@set"].includes(S)))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:h});U["@container"]=$}if("@index"in F){if(!("@container"in F)||!U["@container"].includes("@index"))throw new e(`Invalid JSON-LD syntax; @index without @index in @container: "${F["@index"]}" on term "${m}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:h});if(!n(F["@index"])||F["@index"].indexOf("@")===0)throw new e(`Invalid JSON-LD syntax; @index must expand to an IRI: "${F["@index"]}" on term "${m}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:h});U["@index"]=F["@index"]}if("@context"in F&&(U["@context"]=F["@context"]),"@language"in F&&!("@type"in F)){let $=F["@language"];if($!==null&&!n($))throw new e("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:h});$!==null&&($=$.toLowerCase()),U["@language"]=$}if("@prefix"in F){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:h});if(E.isKeyword(U["@id"]))throw new e("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:h});if(typeof F["@prefix"]=="boolean")U._prefix=F["@prefix"]===!0;else throw new e("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:h})}if("@direction"in F){const $=F["@direction"];if($!==null&&$!=="ltr"&&$!=="rtl")throw new e('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:h});U["@direction"]=$}if("@nest"in F){const $=F["@nest"];if(!n($)||$!=="@nest"&&$.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:h});U["@nest"]=$}// disallow aliasing @context and @preserve
324
+ const Q=U["@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:h});if(I&&I.protected&&!C&&(y.protected[m]=!0,U.protected=!0,!k(I,U)))throw new e("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:h,term:m})},E.expandIri=(y,h,m,T)=>x(y,h,m,void 0,void 0,T);function x(y,h,m,T,N,C){if(h===null||!n(h)||E.isKeyword(h))return h;if(h.match(u))return null;if(T&&T.hasOwnProperty(h)&&N.get(h)!==!0&&E.createTermDefinition({activeCtx:y,localCtx:T,term:h,defined:N,options:C}),m=m||{},m.vocab){const I=y.mappings.get(h);if(I===null)return null;if(r(I)&&"@id"in I)return I["@id"]}const F=h.indexOf(":");if(F>0){const I=h.substr(0,F),O=h.substr(F+1);if(I==="_"||O.indexOf("//")===0)return h;T&&T.hasOwnProperty(I)&&E.createTermDefinition({activeCtx:y,localCtx:T,term:I,defined:N,options:C});const U=y.mappings.get(I);if(U&&U._prefix)return U["@id"]+O;if(o(h))return h}if(m.vocab&&"@vocab"in y)h=y["@vocab"]+h;else if(m.base){let I,O;"@base"in y?y["@base"]?(O=c(C.base,y["@base"]),I=c(O,h)):(O=y["@base"],I=h):(O=C.base,I=c(C.base,h)),h=I}return h}E.getInitialContext=y=>{const h=JSON.stringify({processingMode:y.processingMode}),m=v.get(h);if(m)return m;const T={processingMode:y.processingMode,mappings:new Map,inverse:null,getInverse:N,clone:I,revertToPreviousContext:O,protected:{}};return v.size===_&&v.clear(),v.set(h,T),T;function N(){const U=this;if(U.inverse)return U.inverse;const R=U.inverse={},D=U.fastCurieMap={},Q={},$=(U["@language"]||"@none").toLowerCase(),Y=U["@direction"],B=U.mappings,re=[...B.keys()].sort(g);for(const S of re){const H=B.get(S);if(H===null)continue;let ee=H["@container"]||"@none";if(ee=[].concat(ee).sort().join(""),H["@id"]===null)continue;const J=p(H["@id"]);for(const he of J){let W=R[he];const G=E.isKeyword(he);if(W)!G&&!H._termHasColon&&Q[he].push(S);else if(R[he]=W={},!G&&!H._termHasColon){Q[he]=[S];const X={iri:he,terms:Q[he]};he[0]in D?D[he[0]].push(X):D[he[0]]=[X]}if(W[ee]||(W[ee]={"@language":{},"@type":{},"@any":{}}),W=W[ee],F(S,W["@any"],"@none"),H.reverse)F(S,W["@type"],"@reverse");else if(H["@type"]==="@none")F(S,W["@any"],"@none"),F(S,W["@language"],"@none"),F(S,W["@type"],"@none");else if("@type"in H)F(S,W["@type"],H["@type"]);else if("@language"in H&&"@direction"in H){const X=H["@language"],z=H["@direction"];X&&z?F(S,W["@language"],`${X}_${z}`.toLowerCase()):X?F(S,W["@language"],X.toLowerCase()):z?F(S,W["@language"],`_${z}`):F(S,W["@language"],"@null")}else"@language"in H?F(S,W["@language"],(H["@language"]||"@null").toLowerCase()):"@direction"in H?H["@direction"]?F(S,W["@language"],`_${H["@direction"]}`):F(S,W["@language"],"@none"):Y?(F(S,W["@language"],`_${Y}`),F(S,W["@language"],"@none"),F(S,W["@type"],"@none")):(F(S,W["@language"],$),F(S,W["@language"],"@none"),F(S,W["@type"],"@none"))}}for(const S in D)C(D,S,1);return R}function C(U,R,D){const Q=U[R],$=U[R]={};let Y,B;for(const re of Q)Y=re.iri,D>=Y.length?B="":B=Y[D],B in $?$[B].push(re):$[B]=[re];for(const re in $)re!==""&&C($,re,D+1)}function F(U,R,D){R.hasOwnProperty(D)||(R[D]=U)}function I(){const U={};return U.mappings=i.clone(this.mappings),U.clone=this.clone,U.inverse=null,U.getInverse=this.getInverse,U.protected=i.clone(this.protected),this.previousContext&&(U.previousContext=this.previousContext.clone()),U.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(U["@base"]=this["@base"]),"@language"in this&&(U["@language"]=this["@language"]),"@vocab"in this&&(U["@vocab"]=this["@vocab"]),U}function O(){return this.previousContext?this.previousContext.clone():this}},E.getContextValue=(y,h,m)=>{if(h===null)return m==="@context"?void 0:null;if(y.mappings.has(h)){const T=y.mappings.get(h);if(s(m))return T;if(T.hasOwnProperty(m))return T[m]}if(m==="@language"&&m in y||m==="@direction"&&m in y)return y[m];if(m!=="@context")return null},E.processingMode=(y,h)=>h.toString()>="1.1"?!y.processingMode||y.processingMode>="json-ld-"+h.toString():y.processingMode==="json-ld-1.0",E.isKeyword=y=>{if(!n(y)||y[0]!=="@")return!1;switch(y){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(y,h){if(!(y&&typeof y=="object")||!(h&&typeof h=="object"))return y===h;const m=Array.isArray(y);if(m!==Array.isArray(h))return!1;if(m){if(y.length!==h.length)return!1;for(let C=0;C<y.length;++C)if(!k(y[C],h[C]))return!1;return!0}const T=Object.keys(y),N=Object.keys(h);if(T.length!==N.length)return!1;for(const C in y){let F=y[C],I=h[C];if(C==="@container"&&Array.isArray(F)&&Array.isArray(I)&&(F=F.slice().sort(),I=I.slice().sort()),!k(F,I))return!1}return!0}return ul}var hl,$h;function iy(){if($h)return hl;$h=1;const i=Ei(),{isArray:e,isObject:t,isEmptyObject:r,isString:n,isUndefined:s}=mi(),{isList:o,isValue:a,isGraph:c,isSubject:l}=ar(),{expandIri:d,getContextValue:u,isKeyword:p,process:g,processingMode:v}=Vr(),{isAbsolute:_}=xr(),{REGEX_BCP47:E,REGEX_KEYWORD:x,addValue:k,asArray:y,getValues:h,validateTypeValue:m}=vi(),{handleEvent:T}=Bs(),N={};hl=N,N.expand=async({activeCtx:R,activeProperty:D=null,element:Q,options:$={},insideList:Y=!1,insideIndex:B=!1,typeScopedContext:re=null})=>{if(Q==null)return null;if(D==="@default"&&($=Object.assign({},$,{isFrame:!1})),!e(Q)&&!t(Q))return!Y&&(D===null||d(R,D,{vocab:!0},$)==="@graph")?($.eventHandler&&T({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:Q}},options:$}),null):I({activeCtx:R,activeProperty:D,value:Q,options:$});if(e(Q)){let X=[];const z=u(R,D,"@container")||[];Y=Y||z.includes("@list");for(let ne=0;ne<Q.length;++ne){let se=await N.expand({activeCtx:R,activeProperty:D,element:Q[ne],options:$,insideIndex:B,typeScopedContext:re});Y&&e(se)&&(se={"@list":se}),se!==null&&(e(se)?X=X.concat(se):X.push(se))}return X}const S=d(R,D,{vocab:!0},$),H=u(R,D,"@context");re=re||(R.previousContext?R:null);let ee=Object.keys(Q).sort(),J=!B;if(J&&re&&ee.length<=2&&!ee.includes("@context"))for(const X of ee){const z=d(re,X,{vocab:!0},$);if(z==="@value"){J=!1,R=re;break}if(z==="@id"&&ee.length===1){J=!1;break}}J&&(R=R.revertToPreviousContext()),s(H)||(R=await g({activeCtx:R,localCtx:H,propagate:!0,overrideProtected:!0,options:$})),"@context"in Q&&(R=await g({activeCtx:R,localCtx:Q["@context"],options:$})),re=R;let he=null;for(const X of ee)if(d(R,X,{vocab:!0},$)==="@type"){he=he||X;const ne=Q[X],se=Array.isArray(ne)?ne.length>1?ne.slice().sort():ne:[ne];for(const ye of se){const _e=u(re,ye,"@context");s(_e)||(R=await g({activeCtx:R,localCtx:_e,options:$,propagate:!1}))}}let W={};await F({activeCtx:R,activeProperty:D,expandedActiveProperty:S,element:Q,expandedParent:W,options:$,insideList:Y,typeKey:he,typeScopedContext:re}),ee=Object.keys(W);let G=ee.length;if("@value"in W){if("@type"in W&&("@language"in W||"@direction"in W))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:W});let X=G-1;if("@type"in W&&(X-=1),"@index"in W&&(X-=1),"@language"in W&&(X-=1),"@direction"in W&&(X-=1),X!==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:W});const z=W["@value"]===null?[]:y(W["@value"]),ne=h(W,"@type");if(!(v(R,1.1)&&ne.includes("@json")&&ne.length===1))if(z.length===0)$.eventHandler&&T({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:W}},options:$}),W=null;else{if(!z.every(se=>n(se)||r(se))&&"@language"in W)throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:W});if(!ne.every(se=>_(se)&&!(n(se)&&se.indexOf("_:")===0)||r(se)))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:W})}}else if("@type"in W&&!e(W["@type"]))W["@type"]=[W["@type"]];else if("@set"in W||"@list"in W){if(G>1&&!(G===2&&"@index"in W))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:W});"@set"in W&&(W=W["@set"],ee=Object.keys(W),G=ee.length)}else G===1&&"@language"in W&&($.eventHandler&&T({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:W}},options:$}),W=null);return t(W)&&!$.keepFreeFloatingNodes&&!Y&&(D===null||S==="@graph"||(u(R,D,"@container")||[]).includes("@graph"))&&(W=C({value:W,count:G,options:$})),W};function C({value:R,count:D,options:Q}){if(D===0||"@value"in R||"@list"in R||D===1&&"@id"in R){if(Q.eventHandler){let $,Y;D===0?($="empty object",Y="Dropping empty object."):"@value"in R?($="object with only @value",Y="Dropping object with only @value."):"@list"in R?($="object with only @list",Y="Dropping object with only @list."):D===1&&"@id"in R&&($="object with only @id",Y="Dropping object with only @id."),T({event:{type:["JsonLdEvent"],code:$,level:"warning",message:Y,details:{value:R}},options:Q})}return null}return R}async function F({activeCtx:R,activeProperty:D,expandedActiveProperty:Q,element:$,expandedParent:Y,options:B={},insideList:re,typeKey:S,typeScopedContext:H}){const ee=Object.keys($).sort(),J=[];let he;const W=$[S]&&d(R,e($[S])?$[S][0]:$[S],{vocab:!0},{...B,typeExpansion:!0})==="@json";for(const G of ee){let X=$[G],z;if(G==="@context")continue;const ne=d(R,G,{vocab:!0},B);if(ne===null||!(_(ne)||p(ne))){B.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:G,expandedProperty:ne}},options:B});continue}if(p(ne)){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:X});if(ne in Y&&ne!=="@included"&&ne!=="@type")throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:ne})}if(ne==="@id"){if(!n(X)){if(!B.isFrame)throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:X});if(t(X)){if(!r(X))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:X})}else if(e(X)){if(!X.every(M=>n(M)))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:X})}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:X})}k(Y,"@id",y(X).map(M=>{if(n(M)){const K=d(R,M,{base:!0},B);return B.eventHandler&&(K===null?T(M===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:M}},options:B}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:M}},options:B}):_(K)||T({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:M,expandedId:K}},options:B})),K}return M}),{propertyIsArray:B.isFrame});continue}if(ne==="@type"){t(X)&&(X=Object.fromEntries(Object.entries(X).map(([M,K])=>[d(H,M,{vocab:!0}),y(K).map(ce=>d(H,ce,{base:!0,vocab:!0},{...B,typeExpansion:!0}))]))),m(X,B.isFrame),k(Y,"@type",y(X).map(M=>{if(n(M)){const K=d(H,M,{base:!0,vocab:!0},{...B,typeExpansion:!0});return K!=="@json"&&!_(K)&&B.eventHandler&&T({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:M}},options:B}),K}return M}),{propertyIsArray:!!B.isFrame});continue}if(ne==="@included"&&v(R,1.1)){const M=y(await N.expand({activeCtx:R,activeProperty:D,element:X,options:B}));if(!M.every(K=>l(K)))throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:X});k(Y,"@included",M,{propertyIsArray:!0});continue}if(ne==="@graph"&&!(t(X)||e(X)))throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:X});if(ne==="@value"){he=X,W&&v(R,1.1)?Y["@value"]=X:k(Y,"@value",X,{propertyIsArray:B.isFrame});continue}if(ne==="@language"){if(X===null)continue;if(!n(X)&&!B.isFrame)throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:X});X=y(X).map(M=>n(M)?M.toLowerCase():M);for(const M of X)n(M)&&!M.match(E)&&B.eventHandler&&T({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:M}},options:B});k(Y,"@language",X,{propertyIsArray:B.isFrame});continue}if(ne==="@direction"){if(!n(X)&&!B.isFrame)throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:X});X=y(X);for(const M of X)if(n(M)&&M!=="ltr"&&M!=="rtl")throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:X});k(Y,"@direction",X,{propertyIsArray:B.isFrame});continue}if(ne==="@index"){if(!n(X))throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:X});k(Y,"@index",X);continue}if(ne==="@reverse"){if(!t(X))throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:X});if(z=await N.expand({activeCtx:R,activeProperty:"@reverse",element:X,options:B}),"@reverse"in z)for(const K in z["@reverse"])k(Y,K,z["@reverse"][K],{propertyIsArray:!0});let M=Y["@reverse"]||null;for(const K in z){if(K==="@reverse")continue;M===null&&(M=Y["@reverse"]={}),k(M,K,[],{propertyIsArray:!0});const ce=z[K];for(let be=0;be<ce.length;++be){const ve=ce[be];if(a(ve)||o(ve))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:z});k(M,K,ve,{propertyIsArray:!0})}}continue}if(ne==="@nest"){J.push(G);continue}let se=R;const ye=u(R,G,"@context");s(ye)||(se=await g({activeCtx:R,localCtx:ye,propagate:!0,overrideProtected:!0,options:B}));const _e=u(R,G,"@container")||[];if(_e.includes("@language")&&t(X)){const M=u(se,G,"@direction");z=O(se,X,M,B)}else if(_e.includes("@index")&&t(X)){const M=_e.includes("@graph"),K=u(se,G,"@index")||"@index",ce=K!=="@index"&&d(R,K,{vocab:!0},B);z=await U({activeCtx:se,options:B,activeProperty:G,value:X,asGraph:M,indexKey:K,propertyIndex:ce})}else if(_e.includes("@id")&&t(X)){const M=_e.includes("@graph");z=await U({activeCtx:se,options:B,activeProperty:G,value:X,asGraph:M,indexKey:"@id"})}else if(_e.includes("@type")&&t(X))z=await U({activeCtx:se.revertToPreviousContext(),options:B,activeProperty:G,value:X,asGraph:!1,indexKey:"@type"});else{const M=ne==="@list";if(M||ne==="@set"){let K=D;M&&Q==="@graph"&&(K=null),z=await N.expand({activeCtx:se,activeProperty:K,element:X,options:B,insideList:M})}else u(R,G,"@type")==="@json"?z={"@type":"@json","@value":X}:z=await N.expand({activeCtx:se,activeProperty:G,element:X,options:B,insideList:!1})}if(!(z===null&&ne!=="@value")){if(ne!=="@list"&&!o(z)&&_e.includes("@list")&&(z={"@list":y(z)}),_e.includes("@graph")&&!_e.some(M=>M==="@id"||M==="@index")){if(z=y(z),B.isFrame||(z=z.filter(M=>{const K=Object.keys(M).length;return C({value:M,count:K,options:B})!==null})),z.length===0)continue;z=z.map(M=>({"@graph":y(M)}))}if(se.mappings.has(G)&&se.mappings.get(G).reverse){const M=Y["@reverse"]=Y["@reverse"]||{};z=y(z);for(let K=0;K<z.length;++K){const ce=z[K];if(a(ce)||o(ce))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:z});k(M,ne,ce,{propertyIsArray:!0})}continue}k(Y,ne,z,{propertyIsArray:!0})}}if("@value"in Y&&!(Y["@type"]==="@json"&&v(R,1.1))){if((t(he)||e(he))&&!B.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:he})}for(const G of J){const X=e($[G])?$[G]:[$[G]];for(const z of X){if(!t(z)||Object.keys(z).some(ne=>d(R,ne,{vocab:!0},B)==="@value"))throw new i("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:z});await F({activeCtx:R,activeProperty:D,expandedActiveProperty:Q,element:z,expandedParent:Y,options:B,insideList:re,typeScopedContext:H,typeKey:S})}}}function I({activeCtx:R,activeProperty:D,value:Q,options:$}){if(Q==null)return null;const Y=d(R,D,{vocab:!0},$);if(Y==="@id")return d(R,Q,{base:!0},$);if(Y==="@type")return d(R,Q,{vocab:!0,base:!0},{...$,typeExpansion:!0});const B=u(R,D,"@type");if((B==="@id"||Y==="@graph")&&n(Q)){const S=d(R,Q,{base:!0},$);return S===null&&Q.match(x)&&$.eventHandler&&T({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:D}},options:$}),{"@id":S}}if(B==="@vocab"&&n(Q))return{"@id":d(R,Q,{vocab:!0,base:!0},$)};if(p(Y))return Q;const re={};if(B&&!["@id","@vocab","@none"].includes(B))re["@type"]=B;else if(n(Q)){const S=u(R,D,"@language");S!==null&&(re["@language"]=S);const H=u(R,D,"@direction");H!==null&&(re["@direction"]=H)}return["boolean","number","string"].includes(typeof Q)||(Q=Q.toString()),re["@value"]=Q,re}function O(R,D,Q,$){const Y=[],B=Object.keys(D).sort();for(const re of B){const S=d(R,re,{vocab:!0},$);let H=D[re];e(H)||(H=[H]);for(const ee of H){if(ee===null)continue;if(!n(ee))throw new i("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:D});const J={"@value":ee};S!=="@none"&&(re.match(E)||$.eventHandler&&T({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:re}},options:$}),J["@language"]=re.toLowerCase()),Q&&(J["@direction"]=Q),Y.push(J)}}return Y}async function U({activeCtx:R,options:D,activeProperty:Q,value:$,asGraph:Y,indexKey:B,propertyIndex:re}){const S=[],H=Object.keys($).sort(),ee=B==="@type";for(let J of H){if(ee){const G=u(R,J,"@context");s(G)||(R=await g({activeCtx:R,localCtx:G,propagate:!1,options:D}))}let he=$[J];e(he)||(he=[he]),he=await N.expand({activeCtx:R,activeProperty:Q,element:he,options:D,insideList:!1,insideIndex:!0});let W;re?J==="@none"?W="@none":W=I({activeCtx:R,activeProperty:B,value:J,options:D}):W=d(R,J,{vocab:!0},D),B==="@id"?J=d(R,J,{base:!0},D):ee&&(J=W);for(let G of he){if(Y&&!c(G)&&(G={"@graph":[G]}),B==="@type")W==="@none"||(G["@type"]?G["@type"]=[J].concat(G["@type"]):G["@type"]=[J]);else{if(a(G)&&!["@language","@type","@index"].includes(B))throw new i(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${B}".`,"jsonld.SyntaxError",{code:"invalid value object",value:G});re?W!=="@none"&&k(G,re,W,{propertyIsArray:!0,prependValue:!0}):W!=="@none"&&!(B in G)&&(G[B]=J)}S.push(G)}}return S}return hl}var fl,Ah;function Go(){if(Ah)return fl;Ah=1;const{isKeyword:i}=Vr(),e=ar(),t=mi(),r=vi(),n=Ei(),s={};return fl=s,s.createMergedNodeMap=(o,a)=>{a=a||{};const c=a.issuer||new r.IdentifierIssuer("_:b"),l={"@default":{}};return s.createNodeMap(o,l,"@default",c),s.mergeNodeMaps(l)},s.createNodeMap=(o,a,c,l,d,u)=>{if(t.isArray(o)){for(const _ of o)s.createNodeMap(_,a,c,l,void 0,u);return}if(!t.isObject(o)){u&&u.push(o);return}if(e.isValue(o)){if("@type"in o){let _=o["@type"];_.indexOf("_:")===0&&(o["@type"]=_=l.getId(_))}u&&u.push(o);return}else if(u&&e.isList(o)){const _=[];s.createNodeMap(o["@list"],a,c,l,d,_),u.push({"@list":_});return}if("@type"in o){const _=o["@type"];for(const E of _)E.indexOf("_:")===0&&l.getId(E)}t.isUndefined(d)&&(d=e.isBlankNode(o)?l.getId(o["@id"]):o["@id"]),u&&u.push({"@id":d});const p=a[c],g=p[d]=p[d]||{};g["@id"]=d;const v=Object.keys(o).sort();for(let _ of v){if(_==="@id")continue;if(_==="@reverse"){const x={"@id":d},k=o["@reverse"];for(const y in k){const h=k[y];for(const m of h){let T=m["@id"];e.isBlankNode(m)&&(T=l.getId(T)),s.createNodeMap(m,a,c,l,T),r.addValue(p[T],y,x,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(_==="@graph"){d in a||(a[d]={}),s.createNodeMap(o[_],a,d,l);continue}if(_==="@included"){s.createNodeMap(o[_],a,c,l);continue}if(_!=="@type"&&i(_)){if(_==="@index"&&_ in g&&(o[_]!==g[_]||o[_]["@id"]!==g[_]["@id"]))throw new n("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:g});g[_]=o[_];continue}const E=o[_];if(_.indexOf("_:")===0&&(_=l.getId(_)),E.length===0){r.addValue(g,_,[],{propertyIsArray:!0});continue}for(let x of E)if(_==="@type"&&(x=x.indexOf("_:")===0?l.getId(x):x),e.isSubject(x)||e.isSubjectReference(x)){if("@id"in x&&!x["@id"])continue;const k=e.isBlankNode(x)?l.getId(x["@id"]):x["@id"];r.addValue(g,_,{"@id":k},{propertyIsArray:!0,allowDuplicate:!1}),s.createNodeMap(x,a,c,l,k)}else if(e.isValue(x))r.addValue(g,_,x,{propertyIsArray:!0,allowDuplicate:!1});else if(e.isList(x)){const k=[];s.createNodeMap(x["@list"],a,c,l,d,k),x={"@list":k},r.addValue(g,_,x,{propertyIsArray:!0,allowDuplicate:!1})}else s.createNodeMap(x,a,c,l,d),r.addValue(g,_,x,{propertyIsArray:!0,allowDuplicate:!1})}},s.mergeNodeMapGraphs=o=>{const a={};for(const c of Object.keys(o).sort())for(const l of Object.keys(o[c]).sort()){const d=o[c][l];l in a||(a[l]={"@id":l});const u=a[l];for(const p of Object.keys(d).sort())if(i(p)&&p!=="@type")u[p]=r.clone(d[p]);else for(const g of d[p])r.addValue(u,p,r.clone(g),{propertyIsArray:!0,allowDuplicate:!1})}return a},s.mergeNodeMaps=o=>{const a=o["@default"],c=Object.keys(o).sort();for(const l of c){if(l==="@default")continue;const d=o[l];let u=a[l];u?"@graph"in u||(u["@graph"]=[]):a[l]=u={"@id":l,"@graph":[]};const p=u["@graph"];for(const g of Object.keys(d).sort()){const v=d[g];e.isSubjectReference(v)||p.push(v)}}return a},fl}var pl,Nh;function ry(){if(Nh)return pl;Nh=1;const{isSubjectReference:i}=ar(),{createMergedNodeMap:e}=Go(),t={};return pl=t,t.flatten=r=>{const n=e(r),s=[],o=Object.keys(n).sort();for(let a=0;a<o.length;++a){const c=n[o[a]];i(c)||s.push(c)}return s},pl}var ml,Dh;function ny(){if(Dh)return ml;Dh=1;const i=Ei(),e=ar(),t=mi(),{REGEX_BCP47:r,addValue:n}=vi(),{handleEvent:s}=Bs(),{RDF_LIST:o,RDF_FIRST:a,RDF_REST:c,RDF_NIL:l,RDF_TYPE:d,RDF_JSON_LITERAL:u,XSD_BOOLEAN:p,XSD_DOUBLE:g,XSD_INTEGER:v,XSD_STRING:_}=id(),E={};ml=E,E.fromRDF=async(k,y)=>{const{useRdfType:h=!1,useNativeTypes:m=!1,rdfDirection:T=null}=y,N={},C={"@default":N},F={};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 U of k){const R=U.graph.termType==="DefaultGraph"?"@default":U.graph.value;R in C||(C[R]={}),R!=="@default"&&!(R in N)&&(N[R]={"@id":R});const D=C[R],Q=U.subject.value,$=U.predicate.value,Y=U.object;Q in D||(D[Q]={"@id":Q});const B=D[Q],re=Y.termType.endsWith("Node");if(re&&!(Y.value in D)&&(D[Y.value]={"@id":Y.value}),$===d&&!h&&re){n(B,"@type",Y.value,{propertyIsArray:!0});continue}const S=x(Y,m,T,y);if(n(B,$,S,{propertyIsArray:!0}),re)if(Y.value===l){const H=D[Y.value];"usages"in H||(H.usages=[]),H.usages.push({node:B,property:$,value:S})}else Y.value in F?F[Y.value]=!1:F[Y.value]={node:B,property:$,value:S}}for(const U in C){const R=C[U];if(!(l in R))continue;const D=R[l];if(D.usages){for(let Q of D.usages){let $=Q.node,Y=Q.property,B=Q.value;const re=[],S=[];let H=Object.keys($).length;for(;Y===c&&t.isObject(F[$["@id"]])&&t.isArray($[a])&&$[a].length===1&&t.isArray($[c])&&$[c].length===1&&(H===3||H===4&&t.isArray($["@type"])&&$["@type"].length===1&&$["@type"][0]===o)&&(re.push($[a][0]),S.push($["@id"]),Q=F[$["@id"]],$=Q.node,Y=Q.property,B=Q.value,H=Object.keys($).length,!!e.isBlankNode($)););delete B["@id"],B["@list"]=re.reverse();for(const ee of S)delete R[ee]}delete D.usages}}const I=[],O=Object.keys(N).sort();for(const U of O){const R=N[U];if(U in C){const D=R["@graph"]=[],Q=C[U],$=Object.keys(Q).sort();for(const Y of $){const B=Q[Y];e.isSubjectReference(B)||D.push(B)}}e.isSubjectReference(R)||I.push(R)}return I};function x(k,y,h,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===u){N="@json";try{T["@value"]=JSON.parse(T["@value"])}catch(C){throw new i("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:T["@value"],cause:C})}}if(y){if(N===p)T["@value"]==="true"?T["@value"]=!0:T["@value"]==="false"&&(T["@value"]=!1);else if(t.isNumeric(T["@value"]))if(N===v){const C=parseInt(T["@value"],10);C.toFixed(0)===T["@value"]&&(T["@value"]=C)}else N===g&&(T["@value"]=parseFloat(T["@value"]));[p,v,g,_].includes(N)||(T["@type"]=N)}else if(h==="i18n-datatype"&&N.startsWith("https://www.w3.org/ns/i18n#")){const[,C,F]=N.split(/[#_]/);C.length>0&&(T["@language"]=C,C.match(r)||m.eventHandler&&s({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:C}},options:m})),T["@direction"]=F}else N!==_&&(T["@type"]=N)}return T}return ml}var gl,Lh;function sy(){return Lh||(Lh=1,gl=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])},"")+"}"}),gl}var bl,Oh;function oy(){if(Oh)return bl;Oh=1;const{createNodeMap:i}=Go(),{isKeyword:e}=Vr(),t=ar(),r=sy(),n=Ei(),s=mi(),o=vi(),{handleEvent:a}=Bs(),{RDF_FIRST:c,RDF_REST:l,RDF_NIL:d,RDF_TYPE:u,RDF_JSON_LITERAL:p,RDF_LANGSTRING:g,XSD_BOOLEAN:v,XSD_DOUBLE:_,XSD_INTEGER:E,XSD_STRING:x}=id(),{isAbsolute:k}=xr(),y={};bl=y,y.toRDF=(N,C)=>{const F=new o.IdentifierIssuer("_:b"),I={"@default":{}};i(N,I,"@default",F);const O=[],U=Object.keys(I).sort();for(const R of U){let D;if(R==="@default")D={termType:"DefaultGraph",value:""};else if(k(R))R.startsWith("_:")?D={termType:"BlankNode"}:D={termType:"NamedNode"},D.value=R;else{C.eventHandler&&a({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:R}},options:C});continue}h(O,I[R],D,F,C)}return O};function h(N,C,F,I,O){const U=Object.keys(C).sort();for(const R of U){const D=C[R],Q=Object.keys(D).sort();for(let $ of Q){const Y=D[$];if($==="@type")$=u;else if(e($))continue;for(const B of Y){const re={termType:R.startsWith("_:")?"BlankNode":"NamedNode",value:R};if(!k(R)){O.eventHandler&&a({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:R}},options:O});continue}const S={termType:$.startsWith("_:")?"BlankNode":"NamedNode",value:$};if(!k($)){O.eventHandler&&a({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:$}},options:O});continue}if(S.termType==="BlankNode"&&!O.produceGeneralizedRdf){O.eventHandler&&a({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:I.getOldIds().find(ee=>I.getId(ee)===$)}},options:O});continue}const H=T(B,I,N,F,O.rdfDirection,O);H&&N.push({subject:re,predicate:S,object:H,graph:F})}}}}function m(N,C,F,I,O,U){const R={termType:"NamedNode",value:c},D={termType:"NamedNode",value:l},Q={termType:"NamedNode",value:d},$=N.pop(),Y=$?{termType:"BlankNode",value:C.getId()}:Q;let B=Y;for(const re of N){const S=T(re,C,F,I,O,U),H={termType:"BlankNode",value:C.getId()};F.push({subject:B,predicate:R,object:S,graph:I}),F.push({subject:B,predicate:D,object:H,graph:I}),B=H}if($){const re=T($,C,F,I,O,U);F.push({subject:B,predicate:R,object:re,graph:I}),F.push({subject:B,predicate:D,object:Q,graph:I})}return Y}function T(N,C,F,I,O,U){const R={};if(t.isValue(N)){R.termType="Literal",R.value=void 0,R.datatype={termType:"NamedNode"};let D=N["@value"];const Q=N["@type"]||null;if(Q==="@json")R.value=r(D),R.datatype.value=p;else if(s.isBoolean(D))R.value=D.toString(),R.datatype.value=Q||v;else if(s.isDouble(D)||Q===_)s.isDouble(D)||(D=parseFloat(D)),R.value=D.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),R.datatype.value=Q||_;else if(s.isNumber(D))R.value=D.toFixed(0),R.datatype.value=Q||E;else if("@direction"in N&&O==="i18n-datatype"){const $=(N["@language"]||"").toLowerCase(),Y=N["@direction"],B=`https://www.w3.org/ns/i18n#${$}_${Y}`;R.datatype.value=B,R.value=D}else{if("@direction"in N&&O==="compound-literal")throw new n("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:O});if("@direction"in N&&O)throw new n("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:O});"@language"in N?("@direction"in N&&!O&&U.eventHandler&&a({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:R.value}},options:U}),R.value=D,R.datatype.value=Q||g,R.language=N["@language"]):("@direction"in N&&!O&&U.eventHandler&&a({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:R.value}},options:U}),R.value=D,R.datatype.value=Q||x)}}else if(t.isList(N)){const D=m(N["@list"],C,F,I,O,U);R.termType=D.termType,R.value=D.value}else{const D=s.isObject(N)?N["@id"]:N;R.termType=D.startsWith("_:")?"BlankNode":"NamedNode",R.value=D}return R.termType==="NamedNode"&&!k(R.value)?(U.eventHandler&&a({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:R.value}},options:U}),null):R}return bl}var yl,Ph;function ay(){if(Ph)return yl;Ph=1;const{isKeyword:i}=Vr(),e=ar(),t=mi(),r=vi(),n=xr(),s=Ei(),{createNodeMap:o,mergeNodeMapGraphs:a}=Go(),c={};yl=c,c.frameMergedOrDefault=(h,m,T)=>{const N={options:T,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},C=new r.IdentifierIssuer("_:b");o(h,N.graphMap,"@default",C),T.merged&&(N.graphMap["@merged"]=a(N.graphMap),N.graph="@merged"),N.subjects=N.graphMap[N.graph];const F=[];c.frame(N,Object.keys(N.subjects).sort(),m,F),T.pruneBlankNodeIdentifiers&&(T.bnodesToClear=Object.keys(N.bnodeMap).filter(I=>N.bnodeMap[I].length===1));// remove @preserve from results
325
+ return T.link={},E(F,T)},c.frame=(h,m,T,N,C=null)=>{p(T),T=T[0];const F=h.options,I={embed:u(T,F,"embed"),explicit:u(T,F,"explicit"),requireAll:u(T,F,"requireAll")};h.link.hasOwnProperty(h.graph)||(h.link[h.graph]={});const O=h.link[h.graph],U=g(h,m,T,I),R=Object.keys(U).sort();for(const D of R){const Q=U[D];if(C===null?h.uniqueEmbeds={[h.graph]:{}}:h.uniqueEmbeds[h.graph]=h.uniqueEmbeds[h.graph]||{},I.embed==="@link"&&D in O){x(N,C,O[D]);continue}const $={"@id":D};if(D.indexOf("_:")===0&&r.addValue(h.bnodeMap,D,$,{propertyIsArray:!0}),O[D]=$,(I.embed==="@first"||I.embed==="@last")&&h.is11)throw new s("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:T});if(!(!h.embedded&&h.uniqueEmbeds[h.graph].hasOwnProperty(D))){if(h.embedded&&(I.embed==="@never"||d(Q,h.graph,h.subjectStack))){x(N,C,$);continue}if(h.embedded&&(I.embed=="@first"||I.embed=="@once")&&h.uniqueEmbeds[h.graph].hasOwnProperty(D)){x(N,C,$);continue}if(I.embed==="@last"&&D in h.uniqueEmbeds[h.graph]&&_(h,D),h.uniqueEmbeds[h.graph][D]={parent:N,property:C},h.subjectStack.push({subject:Q,graph:h.graph}),D in h.graphMap){let Y=!1,B=null;"@graph"in T?(B=T["@graph"][0],Y=!(D==="@merged"||D==="@default"),t.isObject(B)||(B={})):(Y=h.graph!=="@merged",B={}),Y&&c.frame({...h,graph:D,embedded:!1},Object.keys(h.graphMap[D]).sort(),[B],$,"@graph")}"@included"in T&&c.frame({...h,embedded:!1},m,T["@included"],$,"@included");for(const Y of Object.keys(Q).sort()){if(i(Y)){if($[Y]=r.clone(Q[Y]),Y==="@type")for(const B of Q["@type"])B.indexOf("_:")===0&&r.addValue(h.bnodeMap,B,$,{propertyIsArray:!0});continue}if(!(I.explicit&&!(Y in T)))for(const B of Q[Y]){const re=Y in T?T[Y]:l(I);if(e.isList(B)){const S=T[Y]&&T[Y][0]&&T[Y][0]["@list"]?T[Y][0]["@list"]:l(I),H={"@list":[]};x($,Y,H);const ee=B["@list"];for(const J of ee)e.isSubjectReference(J)?c.frame({...h,embedded:!0},[J["@id"]],S,H,"@list"):x(H,"@list",r.clone(J))}else e.isSubjectReference(B)?c.frame({...h,embedded:!0},[B["@id"]],re,$,Y):y(re[0],B)&&x($,Y,r.clone(B))}}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 B=T[Y][0]||{};if(!u(B,F,"omitDefault")&&!(Y in $)){let S="@null";"@default"in B&&(S=r.clone(B["@default"])),t.isArray(S)||(S=[S]),$[Y]=[{"@preserve":S}]}}for(const Y of Object.keys(T["@reverse"]||{}).sort()){const B=T["@reverse"][Y];for(const re of Object.keys(h.subjects))r.getValues(h.subjects[re],Y).some(H=>H["@id"]===D)&&($["@reverse"]=$["@reverse"]||{},r.addValue($["@reverse"],Y,[],{propertyIsArray:!0}),c.frame({...h,embedded:!0},[re],B,$["@reverse"][Y],C))}x(N,C,$),h.subjectStack.pop()}}},c.cleanupNull=(h,m)=>{if(t.isArray(h))return h.map(N=>c.cleanupNull(N,m)).filter(N=>N);if(h==="@null")return null;if(t.isObject(h)){if("@id"in h){const T=h["@id"];if(m.link.hasOwnProperty(T)){const N=m.link[T].indexOf(h);if(N!==-1)return m.link[T][N];m.link[T].push(h)}else m.link[T]=[h]}for(const T in h)h[T]=c.cleanupNull(h[T],m)}return h};function l(h){const m={};for(const T in h)h[T]!==void 0&&(m["@"+T]=[h[T]]);return[m]}function d(h,m,T){for(let N=T.length-1;N>=0;--N){const C=T[N];if(C.graph===m&&C.subject["@id"]===h["@id"])return!0}return!1}function u(h,m,T){const N="@"+T;let C=N in h?h[N][0]:m[T];if(T==="embed"){if(C===!0)C="@once";else if(C===!1)C="@never";else if(C!=="@always"&&C!=="@never"&&C!=="@link"&&C!=="@first"&&C!=="@last"&&C!=="@once")throw new s("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:h})}return C}function p(h){if(!t.isArray(h)||h.length!==1||!t.isObject(h[0]))throw new s("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:h});if("@id"in h[0]){for(const m of r.asArray(h[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:h})}if("@type"in h[0]){for(const m of r.asArray(h[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:h})}}function g(h,m,T,N){const C={};for(const F of m){const I=h.graphMap[h.graph][F];v(h,I,T,N)&&(C[F]=I)}return C}function v(h,m,T,N){let C=!0,F=!1;for(const I in T){let O=!1;const U=r.getValues(m,I),R=r.getValues(T,I).length===0;if(I==="@id"){if(t.isEmptyObject(T["@id"][0]||{})?O=!0:T["@id"].length>=0&&(O=T["@id"].includes(U[0])),!N.requireAll)return O}else if(I==="@type"){if(C=!1,R){if(U.length>0)return!1;O=!0}else if(T["@type"].length===1&&t.isEmptyObject(T["@type"][0]))O=U.length>0;else for(const D of T["@type"])t.isObject(D)&&"@default"in D?O=!0:O=O||U.some(Q=>Q===D);if(!N.requireAll)return O}else{if(i(I))continue;{const D=r.getValues(T,I)[0];let Q=!1;if(D&&(p([D]),Q="@default"in D),C=!1,U.length===0&&Q)continue;if(U.length>0&&R)return!1;if(D===void 0){if(U.length>0)return!1;O=!0}else if(e.isList(D)){const $=D["@list"][0];if(e.isList(U[0])){const Y=U[0]["@list"];e.isValue($)?O=Y.some(B=>y($,B)):(e.isSubject($)||e.isSubjectReference($))&&(O=Y.some(B=>k(h,$,B,N)))}}else e.isValue(D)?O=U.some($=>y(D,$)):e.isSubjectReference(D)?O=U.some($=>k(h,D,$,N)):t.isObject(D)?O=U.length>0:O=!1}}if(!O&&N.requireAll)return!1;F=F||O}return C||F}function _(h,m){const T=h.uniqueEmbeds[h.graph],N=T[m],C=N.parent,F=N.property,I={"@id":m};if(t.isArray(C)){for(let U=0;U<C.length;++U)if(r.compareValues(C[U],I)){C[U]=I;break}}else{const U=t.isArray(C[F]);r.removeValue(C,F,I,{propertyIsArray:U}),r.addValue(C,F,I,{propertyIsArray:U})}const O=U=>{const R=Object.keys(T);for(const D of R)D in T&&t.isObject(T[D].parent)&&T[D].parent["@id"]===U&&(delete T[D],O(D))};O(m)}/**
301
326
  * Removes the @preserve keywords from expanded result of framing.
302
327
  *
303
328
  * @param input the framed, framed output.
304
329
  * @param options the framing options used.
305
330
  *
306
331
  * @return the resulting output.
307
- */function E(u,m){if(t.isArray(u))return u.map(T=>E(T,m));if(t.isObject(u)){// remove @preserve
308
- 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 Ua}var Va,Qu;function yy(){if(Qu)return Va;Qu=1;const i=hi(),{isArray:e,isObject:t,isString:r,isUndefined:n}=ri(),{isList:s,isValue:o,isGraph:a,isSimpleGraph:l,isSubjectReference:c}=Gi(),{expandIri:d,getContextValue:f,isKeyword:g,process:y,processingMode:b}=kr(),{removeBase:_,prependBase:E}=or(),{REGEX_KEYWORD:S,addValue:k,asArray:v,compareShortestLeast:u}=li(),m={};Va=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 X=await m.compact({activeCtx:$,activeProperty:j,element:R[L],options:P});X!==null&&I.push(X)}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={},X=$;!o(R)&&!c(R)&&($=$.revertToPreviousContext());const A=f(X,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(X,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:X,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 X=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)&&(X===null||u(J,X)<0)&&(X=J)}}if(X!==null)return X;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 X=f($,j,"@type"),A=f($,j,"@language"),Y=f($,j,"@direction"),F=f($,j,"@container")||[],te="@index"in R&&!F.includes("@index");if(!te&&X!=="@none"&&(R["@type"]===X||"@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&&X!=="@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 X=$.inverse[j];for(const A of P){if(!(A in X))continue;const Y=X[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 Va}var za,Xu;function by(){return Xu||(Xu=1,za=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}),za}/**
332
+ */function E(h,m){if(t.isArray(h))return h.map(T=>E(T,m));if(t.isObject(h)){// remove @preserve
333
+ if("@preserve"in h)return h["@preserve"][0];if(e.isValue(h))return h;if(e.isList(h))return h["@list"]=E(h["@list"],m),h;if("@id"in h){const T=h["@id"];if(m.link.hasOwnProperty(T)){const N=m.link[T].indexOf(h);if(N!==-1)return m.link[T][N];m.link[T].push(h)}else m.link[T]=[h]}for(const T in h){if(T==="@id"&&m.bnodesToClear.includes(h[T])){delete h["@id"];continue}h[T]=E(h[T],m)}}return h}function x(h,m,T){t.isObject(h)?r.addValue(h,m,T,{propertyIsArray:!0}):h.push(T)}function k(h,m,T,N){if(!("@id"in T))return!1;const C=h.subjects[T["@id"]];return C&&v(h,C,m,N)}function y(h,m){const T=m["@value"],N=m["@type"],C=m["@language"],F=h["@value"]?t.isArray(h["@value"])?h["@value"]:[h["@value"]]:[],I=h["@type"]?t.isArray(h["@type"])?h["@type"]:[h["@type"]]:[],O=h["@language"]?t.isArray(h["@language"])?h["@language"]:[h["@language"]]:[];return F.length===0&&I.length===0&&O.length===0?!0:!(!(F.includes(T)||t.isEmptyObject(F[0]))||!(!N&&I.length===0||I.includes(N)||N&&t.isEmptyObject(I[0]))||!(!C&&O.length===0||O.includes(C)||C&&t.isEmptyObject(O[0])))}return yl}var vl,Mh;function ly(){if(Mh)return vl;Mh=1;const i=Ei(),{isArray:e,isObject:t,isString:r,isUndefined:n}=mi(),{isList:s,isValue:o,isGraph:a,isSimpleGraph:c,isSubjectReference:l}=ar(),{expandIri:d,getContextValue:u,isKeyword:p,process:g,processingMode:v}=Vr(),{removeBase:_,prependBase:E}=xr(),{REGEX_KEYWORD:x,addValue:k,asArray:y,compareShortestLeast:h}=vi(),m={};vl=m,m.compact=async({activeCtx:C,activeProperty:F=null,element:I,options:O={}})=>{if(e(I)){let R=[];for(let D=0;D<I.length;++D){const Q=await m.compact({activeCtx:C,activeProperty:F,element:I[D],options:O});Q!==null&&R.push(Q)}return O.compactArrays&&R.length===1&&(u(C,F,"@container")||[]).length===0&&(R=R[0]),R}const U=u(C,F,"@context");if(n(U)||(C=await g({activeCtx:C,localCtx:U,propagate:!0,overrideProtected:!0,options:O})),t(I)){if(O.link&&"@id"in I&&O.link.hasOwnProperty(I["@id"])){const S=O.link[I["@id"]];for(let H=0;H<S.length;++H)if(S[H].expanded===I)return S[H].compacted}if(o(I)||l(I)){const S=m.compactValue({activeCtx:C,activeProperty:F,value:I,options:O});return O.link&&l(I)&&(O.link.hasOwnProperty(I["@id"])||(O.link[I["@id"]]=[]),O.link[I["@id"]].push({expanded:I,compacted:S})),S}if(s(I)&&(u(C,F,"@container")||[]).includes("@list"))return m.compact({activeCtx:C,activeProperty:F,element:I["@list"],options:O});const R=F==="@reverse",D={},Q=C;!o(I)&&!l(I)&&(C=C.revertToPreviousContext());const $=u(Q,F,"@context");n($)||(C=await g({activeCtx:C,localCtx:$,propagate:!0,overrideProtected:!0,options:O})),O.link&&"@id"in I&&(O.link.hasOwnProperty(I["@id"])||(O.link[I["@id"]]=[]),O.link[I["@id"]].push({expanded:I,compacted:D}));let Y=I["@type"]||[];Y.length>1&&(Y=Array.from(Y).sort());const B=C;for(const S of Y){const H=m.compactIri({activeCtx:B,iri:S,relativeTo:{vocab:!0}}),ee=u(Q,H,"@context");n(ee)||(C=await g({activeCtx:C,localCtx:ee,options:O,propagate:!1}))}const re=Object.keys(I).sort();for(const S of re){const H=I[S];if(S==="@id"){let ee=y(H).map(he=>m.compactIri({activeCtx:C,iri:he,relativeTo:{vocab:!1},base:O.base}));ee.length===1&&(ee=ee[0]);const J=m.compactIri({activeCtx:C,iri:"@id",relativeTo:{vocab:!0}});D[J]=ee;continue}if(S==="@type"){let ee=y(H).map(X=>m.compactIri({activeCtx:Q,iri:X,relativeTo:{vocab:!0}}));ee.length===1&&(ee=ee[0]);const J=m.compactIri({activeCtx:C,iri:"@type",relativeTo:{vocab:!0}}),G=(u(C,J,"@container")||[]).includes("@set")&&v(C,1.1)||e(ee)&&H.length===0;k(D,J,ee,{propertyIsArray:G});continue}if(S==="@reverse"){const ee=await m.compact({activeCtx:C,activeProperty:"@reverse",element:H,options:O});for(const J in ee)if(C.mappings.has(J)&&C.mappings.get(J).reverse){const he=ee[J],G=(u(C,J,"@container")||[]).includes("@set")||!O.compactArrays;k(D,J,he,{propertyIsArray:G}),delete ee[J]}if(Object.keys(ee).length>0){const J=m.compactIri({activeCtx:C,iri:S,relativeTo:{vocab:!0}});k(D,J,ee)}continue}if(S==="@preserve"){const ee=await m.compact({activeCtx:C,activeProperty:F,element:H,options:O});e(ee)&&ee.length===0||k(D,S,ee);continue}if(S==="@index"){if((u(C,F,"@container")||[]).includes("@index"))continue;const J=m.compactIri({activeCtx:C,iri:S,relativeTo:{vocab:!0}});k(D,J,H);continue}if(S!=="@graph"&&S!=="@list"&&S!=="@included"&&p(S)){const ee=m.compactIri({activeCtx:C,iri:S,relativeTo:{vocab:!0}});k(D,ee,H);continue}if(!e(H))throw new i("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(H.length===0){const ee=m.compactIri({activeCtx:C,iri:S,value:H,relativeTo:{vocab:!0},reverse:R}),J=C.mappings.has(ee)?C.mappings.get(ee)["@nest"]:null;let he=D;J&&(N(C,J,O),t(D[J])||(D[J]={}),he=D[J]),k(he,ee,H,{propertyIsArray:!0})}for(const ee of H){const J=m.compactIri({activeCtx:C,iri:S,value:ee,relativeTo:{vocab:!0},reverse:R}),he=C.mappings.has(J)?C.mappings.get(J)["@nest"]:null;let W=D;he&&(N(C,he,O),t(D[he])||(D[he]={}),W=D[he]);const G=u(C,J,"@container")||[],X=a(ee),z=s(ee);let ne;z?ne=ee["@list"]:X&&(ne=ee["@graph"]);let se=await m.compact({activeCtx:C,activeProperty:J,element:z||X?ne:ee,options:O});if(z)if(e(se)||(se=[se]),!G.includes("@list"))se={[m.compactIri({activeCtx:C,iri:"@list",relativeTo:{vocab:!0}})]:se},"@index"in ee&&(se[m.compactIri({activeCtx:C,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]);else{k(W,J,se,{valueIsArray:!0,allowDuplicate:!0});continue}if(X)if(G.includes("@graph")&&(G.includes("@id")||G.includes("@index")&&c(ee))){let ye;W.hasOwnProperty(J)?ye=W[J]:W[J]=ye={};const _e=(G.includes("@id")?ee["@id"]:ee["@index"])||m.compactIri({activeCtx:C,iri:"@none",relativeTo:{vocab:!0}});k(ye,_e,se,{propertyIsArray:!O.compactArrays||G.includes("@set")})}else G.includes("@graph")&&c(ee)?(e(se)&&se.length>1&&(se={"@included":se}),k(W,J,se,{propertyIsArray:!O.compactArrays||G.includes("@set")})):(e(se)&&se.length===1&&O.compactArrays&&(se=se[0]),se={[m.compactIri({activeCtx:C,iri:"@graph",relativeTo:{vocab:!0}})]:se},"@id"in ee&&(se[m.compactIri({activeCtx:C,iri:"@id",relativeTo:{vocab:!0}})]=ee["@id"]),"@index"in ee&&(se[m.compactIri({activeCtx:C,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]),k(W,J,se,{propertyIsArray:!O.compactArrays||G.includes("@set")}));else if(G.includes("@language")||G.includes("@index")||G.includes("@id")||G.includes("@type")){let ye;W.hasOwnProperty(J)?ye=W[J]:W[J]=ye={};let _e;if(G.includes("@language"))o(se)&&(se=se["@value"]),_e=ee["@language"];else if(G.includes("@index")){const M=u(C,J,"@index")||"@index",K=m.compactIri({activeCtx:C,iri:M,relativeTo:{vocab:!0}});if(M==="@index")_e=ee["@index"],delete se[K];else{let ce;if([_e,...ce]=y(se[M]||[]),!r(_e))_e=null;else switch(ce.length){case 0:delete se[M];break;case 1:se[M]=ce[0];break;default:se[M]=ce;break}}}else if(G.includes("@id")){const M=m.compactIri({activeCtx:C,iri:"@id",relativeTo:{vocab:!0}});_e=se[M],delete se[M]}else if(G.includes("@type")){const M=m.compactIri({activeCtx:C,iri:"@type",relativeTo:{vocab:!0}});let K;switch([_e,...K]=y(se[M]||[]),K.length){case 0:delete se[M];break;case 1:se[M]=K[0];break;default:se[M]=K;break}Object.keys(se).length===1&&"@id"in ee&&(se=await m.compact({activeCtx:C,activeProperty:J,element:{"@id":ee["@id"]},options:O}))}_e||(_e=m.compactIri({activeCtx:C,iri:"@none",relativeTo:{vocab:!0}})),k(ye,_e,se,{propertyIsArray:G.includes("@set")})}else{const ye=!O.compactArrays||G.includes("@set")||G.includes("@list")||e(se)&&se.length===0||S==="@list"||S==="@graph";k(W,J,se,{propertyIsArray:ye})}}}return D}return I},m.compactIri=({activeCtx:C,iri:F,value:I=null,relativeTo:O={vocab:!1},reverse:U=!1,base:R=null})=>{if(F===null)return F;C.isPropertyTermScoped&&C.previousContext&&(C=C.previousContext);const D=C.getInverse();if(p(F)&&F in D&&"@none"in D[F]&&"@type"in D[F]["@none"]&&"@none"in D[F]["@none"]["@type"])return D[F]["@none"]["@type"]["@none"];if(O.vocab&&F in D){const re=C["@language"]||"@none",S=[];t(I)&&"@index"in I&&!("@graph"in I)&&S.push("@index","@index@set"),t(I)&&"@preserve"in I&&(I=I["@preserve"][0]),a(I)?("@index"in I&&S.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in I&&S.push("@graph@id","@graph@id@set"),S.push("@graph","@graph@set","@set"),"@index"in I||S.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in I||S.push("@graph@id","@graph@id@set")):t(I)&&!o(I)&&S.push("@id","@id@set","@type","@set@type");let H="@language",ee="@null";if(U)H="@type",ee="@reverse",S.push("@set");else if(s(I)){"@index"in I||S.push("@list");const he=I["@list"];if(he.length===0)H="@any",ee="@none";else{let W=he.length===0?re:null,G=null;for(let X=0;X<he.length;++X){const z=he[X];let ne="@none",se="@none";if(o(z))if("@direction"in z){const ye=(z["@language"]||"").toLowerCase(),_e=z["@direction"];ne=`${ye}_${_e}`}else"@language"in z?ne=z["@language"].toLowerCase():"@type"in z?se=z["@type"]:ne="@null";else se="@id";if(W===null?W=ne:ne!==W&&o(z)&&(W="@none"),G===null?G=se:se!==G&&(G="@none"),W==="@none"&&G==="@none")break}W=W||"@none",G=G||"@none",G!=="@none"?(H="@type",ee=G):ee=W}}else{if(o(I))if("@language"in I&&!("@index"in I)){S.push("@language","@language@set"),ee=I["@language"];const he=I["@direction"];he&&(ee=`${ee}_${he}`)}else"@direction"in I&&!("@index"in I)?ee=`_${I["@direction"]}`:"@type"in I&&(H="@type",ee=I["@type"]);else H="@type",ee="@id";S.push("@set")}S.push("@none"),t(I)&&!("@index"in I)&&S.push("@index","@index@set"),o(I)&&Object.keys(I).length===1&&S.push("@language","@language@set");const J=T(C,F,I,S,H,ee);if(J!==null)return J}if(O.vocab&&"@vocab"in C){const re=C["@vocab"];if(F.indexOf(re)===0&&F!==re){const S=F.substr(re.length);if(!C.mappings.has(S))return S}}let Q=null;const $=[];let Y=C.fastCurieMap;const B=F.length-1;for(let re=0;re<B&&F[re]in Y;++re)Y=Y[F[re]],""in Y&&$.push(Y[""][0]);for(let re=$.length-1;re>=0;--re){const S=$[re],H=S.terms;for(const ee of H){const J=ee+":"+F.substr(S.iri.length);C.mappings.get(ee)._prefix&&(!C.mappings.has(J)||I===null&&C.mappings.get(J)["@id"]===F)&&(Q===null||h(J,Q)<0)&&(Q=J)}}if(Q!==null)return Q;for(const[re,S]of C.mappings)if(S&&S._prefix&&F.startsWith(re+":"))throw new i(`Absolute IRI "${F}" confused with prefix "${re}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:C});if(!O.vocab)if("@base"in C)if(C["@base"]){const re=_(E(R,C["@base"]),F);return x.test(re)?`./${re}`:re}else return F;else return _(R,F);return F},m.compactValue=({activeCtx:C,activeProperty:F,value:I,options:O})=>{if(o(I)){const Q=u(C,F,"@type"),$=u(C,F,"@language"),Y=u(C,F,"@direction"),B=u(C,F,"@container")||[],re="@index"in I&&!B.includes("@index");if(!re&&Q!=="@none"&&(I["@type"]===Q||"@language"in I&&I["@language"]===$&&"@direction"in I&&I["@direction"]===Y||"@language"in I&&I["@language"]===$||"@direction"in I&&I["@direction"]===Y))return I["@value"];const S=Object.keys(I).length,H=S===1||S===2&&"@index"in I&&!re,ee="@language"in C,J=r(I["@value"]),he=C.mappings.has(F)&&C.mappings.get(F)["@language"]===null;if(H&&Q!=="@none"&&(!ee||!J||he))return I["@value"];const W={};return re&&(W[m.compactIri({activeCtx:C,iri:"@index",relativeTo:{vocab:!0}})]=I["@index"]),"@type"in I?W[m.compactIri({activeCtx:C,iri:"@type",relativeTo:{vocab:!0}})]=m.compactIri({activeCtx:C,iri:I["@type"],relativeTo:{vocab:!0}}):"@language"in I&&(W[m.compactIri({activeCtx:C,iri:"@language",relativeTo:{vocab:!0}})]=I["@language"]),"@direction"in I&&(W[m.compactIri({activeCtx:C,iri:"@direction",relativeTo:{vocab:!0}})]=I["@direction"]),W[m.compactIri({activeCtx:C,iri:"@value",relativeTo:{vocab:!0}})]=I["@value"],W}const U=d(C,F,{vocab:!0},O),R=u(C,F,"@type"),D=m.compactIri({activeCtx:C,iri:I["@id"],relativeTo:{vocab:R==="@vocab"},base:O.base});return R==="@id"||R==="@vocab"||U==="@graph"?D:{[m.compactIri({activeCtx:C,iri:"@id",relativeTo:{vocab:!0}})]:D}};function T(C,F,I,O,U,R){R===null&&(R="@null");const D=[];if((R==="@id"||R==="@reverse")&&t(I)&&"@id"in I){R==="@reverse"&&D.push("@reverse");const $=m.compactIri({activeCtx:C,iri:I["@id"],relativeTo:{vocab:!0}});C.mappings.has($)&&C.mappings.get($)&&C.mappings.get($)["@id"]===I["@id"]?D.push.apply(D,["@vocab","@id"]):D.push.apply(D,["@id","@vocab"])}else{D.push(R);const $=D.find(Y=>Y.includes("_"));$&&D.push($.replace(/^[^_]+_/,"_"))}D.push("@none");const Q=C.inverse[F];for(const $ of O){if(!($ in Q))continue;const Y=Q[$][U];for(const B of D)if(B in Y)return Y[B]}return null}function N(C,F,I){if(d(C,F,{vocab:!0},I)!=="@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 vl}var wl,Fh;function cy(){return Fh||(Fh=1,wl=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}),wl}/**
309
334
  * A JavaScript implementation of the JSON-LD API.
310
335
  *
311
336
  * @author Dave Longley
@@ -339,110 +364,110 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
339
364
  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
340
365
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
341
366
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
342
- */var Ha,Yu;function vy(){if(Yu)return Ha;Yu=1;const i=Ic(),e=sy(),t=li(),r=cy(),n=t.IdentifierIssuer,s=hi(),o=Gf(),a=dy(),{expand:l}=uy(),{flatten:c}=hy(),{fromRDF:d}=fy(),{toRDF:f}=my(),{frameMergedOrDefault:g,cleanupNull:y}=gy(),{isArray:b,isObject:_,isString:E}=ri(),{isSubjectReference:S}=Gi(),{expandIri:k,getInitialContext:v,process:u,processingMode:m}=kr(),{compact:T,compactIri:N}=yy(),{createNodeMap:$,createMergedNodeMap:j,mergeNodeMaps:R}=go(),{logEventHandler:P,logWarningEventHandler:q,safeEventHandler:I,setDefaultEventHandler:L,setupEventHandler:X,strictEventHandler:A,unhandledEventHandler:Y}=fs(),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=kr().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=Wf(),x.JsonLdProcessor=by()(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:X({options:H})})}return x},te=function(){return F(function(){return te()})};return F(te),Ha=te,Ha}var wy=vy();const Wa={},Ga={};let Cl;class _y{constructor(e){this.loadedExternalUrls=[],this.loadedClasses=[],this.config=e}async loadGraphs(){this.loadedExternalUrls=[],this.loadedClasses=[];let e=Cl;this.config.prefixes={};const t=[];if(e||(e=new It,t.push(this.importRDF(this.config.attributes.shapes?this.config.attributes.shapes:this.config.attributes.shapesUrl?this.fetchRDF(this.config.attributes.shapesUrl):"",e,zs))),t.push(this.importRDF(this.config.attributes.values?this.config.attributes.values:this.config.attributes.valuesUrl?this.fetchRDF(this.config.attributes.valuesUrl):"",e,Ii,new _l({blankNodePrefix:""}))),await Promise.all(t),!Cl&&e?.size==0&&this.config.attributes.valuesSubject){const r=[...e.getObjects(this.config.attributes.valuesSubject,Tt,Ii),...e.getObjects(this.config.attributes.valuesSubject,El,Ii)],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,zs)))}try{await Promise.allSettled(n)}catch(s){console.warn(s)}}this.config.store=e}async importRDF(e,t,r,n){const s=n||new _l,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 oo(g.subject,g.predicate,g.object,r)),this.config.attributes.ignoreOwlImports===null&&uc.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,Fe.namedNode(b),n)))}if(this.config.classInstanceProvider&&hc.equals(g.predicate)){const b=g.object.value;if(this.loadedClasses.indexOf(b)<0){let _;b in Ga?_=Ga[b]:(_=this.config.classInstanceProvider(b),Ga[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 wy.toRDF(JSON.parse(e),{format:"application/n-quads"})}catch{}await o(e)}}async fetchRDF(e){if(e in Wa)return Wa[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 Wa[e]=t,t}toURL(e){if(Il(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),Il(e)))return e}}return null}}function xy(i){Cl=i}class Ka{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 Zu{constructor(e,t){this.attributes=new Ka,this.loader=new _y(this),this.prefixes={},this.editMode=!0,this.lists={},this.groups=[],this.renderedNodes=new Set,this._store=new It,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 Ka;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=Fe.namedNode(t.valuesGraph))}static dataAttributes(){const e=new Ka;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)},Tt,`${Ae}PropertyGroup`,null)}registerPrefixes(e){for(const t in e)t&&(this.prefixes[t]=e[t])}}function Ey(i){return"_:"+i.value}function Sy(i,e){return[...i].map(t=>e(t)).join(`
367
+ */var _l,jh;function dy(){if(jh)return _l;jh=1;const i=td(),e=Jb(),t=vi(),r=ey(),n=t.IdentifierIssuer,s=Ei(),o=Op(),a=ty(),{expand:c}=iy(),{flatten:l}=ry(),{fromRDF:d}=ny(),{toRDF:u}=oy(),{frameMergedOrDefault:p,cleanupNull:g}=ay(),{isArray:v,isObject:_,isString:E}=mi(),{isSubjectReference:x}=ar(),{expandIri:k,getInitialContext:y,process:h,processingMode:m}=Vr(),{compact:T,compactIri:N}=ly(),{createNodeMap:C,createMergedNodeMap:F,mergeNodeMaps:I}=Go(),{logEventHandler:O,logWarningEventHandler:U,safeEventHandler:R,setDefaultEventHandler:D,setupEventHandler:Q,strictEventHandler:$,unhandledEventHandler:Y}=Bs(),B=function(S){const H={},J=new o({max:100});S.compact=async function(W,G,X){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(G===null)throw new s("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(W===null)return null;X=he(X,{base:E(W)?W:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new n("_:b"),contextResolver:new r({sharedCache:J})}),X.link&&(X.skipExpansion=!0),X.compactToRelative||delete X.base;let z;X.skipExpansion?z=W:z=await S.expand(W,X);const ne=await S.processContext(y(X),G,X);let se=await T({activeCtx:ne,element:z,options:X});X.compactArrays&&!X.graph&&v(se)?se.length===1?se=se[0]:se.length===0&&(se={}):X.graph&&_(se)&&(se=[se]),_(G)&&"@context"in G&&(G=G["@context"]),G=t.clone(G),v(G)||(G=[G]);const ye=G;G=[];for(let M=0;M<ye.length;++M)(!_(ye[M])||Object.keys(ye[M]).length>0)&&G.push(ye[M]);const _e=G.length>0;if(G.length===1&&(G=G[0]),v(se)){const M=N({activeCtx:ne,iri:"@graph",relativeTo:{vocab:!0}}),K=se;se={},_e&&(se["@context"]=G),se[M]=K}else if(_(se)&&_e){const M=se;se={"@context":G};for(const K in M)se[K]=M[K]}return se},S.expand=async function(W,G){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");G=he(G,{keepFreeFloatingNodes:!1,contextResolver:new r({sharedCache:J})});const X={},z=[];if("expandContext"in G){const _e=t.clone(G.expandContext);_(_e)&&"@context"in _e?X.expandContext=_e:X.expandContext={"@context":_e},z.push(X.expandContext)}let ne;if(!E(W))X.input=t.clone(W);else{const _e=await S.get(W,G);ne=_e.documentUrl,X.input=_e.document,_e.contextUrl&&(X.remoteContext={"@context":_e.contextUrl},z.push(X.remoteContext))}"base"in G||(G.base=ne||"");let se=y(G);for(const _e of z)se=await h({activeCtx:se,localCtx:_e,options:G});let ye=await c({activeCtx:se,element:X.input,options:G});return _(ye)&&"@graph"in ye&&Object.keys(ye).length===1?ye=ye["@graph"]:ye===null&&(ye=[]),v(ye)||(ye=[ye]),ye},S.flatten=async function(W,G,X){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");typeof G=="function"?G=null:G=G||null,X=he(X,{base:E(W)?W:"",contextResolver:new r({sharedCache:J})});const z=await S.expand(W,X),ne=l(z);return G===null?ne:(X.graph=!0,X.skipExpansion=!0,await S.compact(ne,G,X))},S.frame=async function(W,G,X){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(X=he(X,{base:E(W)?W:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new r({sharedCache:J})}),E(G)){const be=await S.get(G,X);if(G=be.document,be.contextUrl){let ve=G["@context"];ve?v(ve)?ve.push(be.contextUrl):ve=[ve,be.contextUrl]:ve=be.contextUrl,G["@context"]=ve}}const z=G?G["@context"]||{}:{},ne=await S.processContext(y(X),z,X);X.hasOwnProperty("omitGraph")||(X.omitGraph=m(ne,1.1)),X.hasOwnProperty("pruneBlankNodeIdentifiers")||(X.pruneBlankNodeIdentifiers=m(ne,1.1));const se=await S.expand(W,X),ye={...X};ye.isFrame=!0,ye.keepFreeFloatingNodes=!0;const _e=await S.expand(G,ye),M=Object.keys(G).map(be=>k(ne,be,{vocab:!0}));ye.merged=!M.includes("@graph"),ye.is11=m(ne,1.1);const K=p(se,_e,ye);ye.graph=!X.omitGraph,ye.skipExpansion=!0,ye.link={},ye.framing=!0;let ce=await S.compact(K,z,ye);return ye.link={},ce=g(ce,ye),ce},S.link=async function(W,G,X){const z={};return G&&(z["@context"]=G),z["@embed"]="@link",S.frame(W,z,X)},S.normalize=S.canonize=async function(W,G){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if(G=he(G,{base:E(W)?W:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new r({sharedCache:J})}),"inputFormat"in G){if(G.inputFormat!=="application/n-quads"&&G.inputFormat!=="application/nquads")throw new s("Unknown canonicalization input format.","jsonld.CanonizeError");const ne=a.parse(W);return i.canonize(ne,G)}const X={...G};delete X.format,X.produceGeneralizedRdf=!1;const z=await S.toRDF(W,X);return i.canonize(z,G)},S.fromRDF=async function(W,G){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");G=he(G,{format:E(W)?"application/n-quads":void 0});const{format:X}=G;let{rdfParser:z}=G;if(X){if(z=z||H[X],!z)throw new s("Unknown input format.","jsonld.UnknownFormat",{format:X})}else z=()=>W;const ne=await z(W);return d(ne,G)},S.toRDF=async function(W,G){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");G=he(G,{base:E(W)?W:"",skipExpansion:!1,contextResolver:new r({sharedCache:J})});let X;G.skipExpansion?X=W:X=await S.expand(W,G);const z=u(X,G);if(G.format){if(G.format==="application/n-quads"||G.format==="application/nquads")return a.serialize(z);throw new s("Unknown output format.","jsonld.UnknownFormat",{format:G.format})}return z},S.createNodeMap=async function(W,G){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");G=he(G,{base:E(W)?W:"",contextResolver:new r({sharedCache:J})});const X=await S.expand(W,G);return F(X,G)},S.merge=async function(W,G,X){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!v(W))throw new TypeError('Could not merge, "docs" must be an array.');typeof G=="function"?G=null:G=G||null,X=he(X,{contextResolver:new r({sharedCache:J})});const z=await Promise.all(W.map(be=>{const ve={...X};return S.expand(be,ve)}));let ne=!0;"mergeNodes"in X&&(ne=X.mergeNodes);const se=X.issuer||new n("_:b"),ye={"@default":{}};for(let be=0;be<z.length;++be){const ve=t.relabelBlankNodes(z[be],{issuer:new n("_:b"+be+"-")}),xe=ne||be===0?ye:{"@default":{}};if(C(ve,xe,"@default",se),xe!==ye)for(const ie in xe){const me=xe[ie];if(!(ie in ye)){ye[ie]=me;continue}const Ee=ye[ie];for(const fe in me)fe in Ee||(Ee[fe]=me[fe])}}const _e=I(ye),M=[],K=Object.keys(_e).sort();for(let be=0;be<K.length;++be){const ve=_e[K[be]];x(ve)||M.push(ve)}return G===null?M:(X.graph=!0,X.skipExpansion=!0,await S.compact(M,G,X))},Object.defineProperty(S,"documentLoader",{get:()=>S._documentLoader,set:W=>S._documentLoader=W}),S.documentLoader=async W=>{throw new s("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:W})},S.get=async function(W,G){let X;typeof G.documentLoader=="function"?X=G.documentLoader:X=S.documentLoader;const z=await X(W);try{if(!z.document)throw new s("No remote document found at the given URL.","jsonld.NullRemoteDocument");E(z.document)&&(z.document=JSON.parse(z.document))}catch(ne){throw new s("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:ne,remoteDoc:z})}return z},S.processContext=async function(W,G,X){return X=he(X,{base:"",contextResolver:new r({sharedCache:J})}),G===null?y(X):(G=t.clone(G),_(G)&&"@context"in G||(G={"@context":G}),h({activeCtx:W,localCtx:G,options:X}))},S.getContextValue=Vr().getContextValue,S.documentLoaders={},S.useDocumentLoader=function(W){if(!(W in S.documentLoaders))throw new s('Unknown document loader type: "'+W+'"',"jsonld.UnknownDocumentLoader",{type:W});S.documentLoader=S.documentLoaders[W].apply(S,Array.prototype.slice.call(arguments,1))},S.registerRDFParser=function(W,G){H[W]=G},S.unregisterRDFParser=function(W){delete H[W]},S.registerRDFParser("application/n-quads",a.parse),S.registerRDFParser("application/nquads",a.parse),S.url=xr(),S.logEventHandler=O,S.logWarningEventHandler=U,S.safeEventHandler=R,S.setDefaultEventHandler=D,S.strictEventHandler=$,S.unhandledEventHandler=Y,S.util=t,Object.assign(S,t),S.promises=S,S.RequestQueue=Lp(),S.JsonLdProcessor=cy()(S),e.setupGlobals(S),e.setupDocumentLoaders(S);function he(W,{documentLoader:G=S.documentLoader,...X}){if(W&&"compactionMap"in W)throw new s('"compactionMap" not supported.',"jsonld.OptionsError");if(W&&"expansionMap"in W)throw new s('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:G},X,W,{eventHandler:Q({options:W})})}return S},re=function(){return B(function(){return re()})};return B(re),_l=re,_l}var uy=dy();const xl={},El={},hy=new zf;let nc;class fy{constructor(e){this.loadedExternalUrls=[],this.loadedClasses=[],this.config=e}async loadGraphs(){this.loadedExternalUrls=[],this.loadedClasses=[];let e=nc;this.config.prefixes={};const t=[];if(e||(e=new jt,t.push(this.importRDF(this.config.attributes.shapes?this.config.attributes.shapes:this.config.attributes.shapesUrl?ao(this.config.attributes.shapesUrl):"",e,xo))),t.push(this.importRDF(this.config.attributes.values?this.config.attributes.values:this.config.attributes.valuesUrl?ao(this.config.attributes.valuesUrl):"",e,Fi)),await Promise.all(t),!nc&&e?.size==0&&this.config.attributes.valuesSubject){const r=[...e.getObjects(this.config.attributes.valuesSubject,qt,Fi),...e.getObjects(this.config.attributes.valuesSubject,Yl,Fi)],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(ao(o),e,xo)))}try{await Promise.allSettled(n)}catch(s){console.warn(s)}}this.config.store=e}async importRDF(e,t,r){const n=async s=>{const o=[];await new Promise((a,c)=>{const l=u=>{if(t.add(new Fo(u.subject,u.predicate,u.object,r)),this.config.attributes.ignoreOwlImports===null&&jc.equals(u.predicate)){const p=this.toURL(u.object.value);p&&this.loadedExternalUrls.indexOf(p)<0&&(this.loadedExternalUrls.push(p),o.push(this.importRDF(ao(p),t,He.namedNode(p))))}if(this.config.classInstanceProvider&&Bc.equals(u.predicate)){const p=u.object.value;if(this.loadedClasses.indexOf(p)<0){let g;p in El?g=El[p]:(g=this.config.classInstanceProvider(p),El[p]=g),this.loadedClasses.push(p),o.push(this.importRDF(g,t,r))}}};if(Bh(s)==="xml"){const u=new qb.RdfXmlParser;u.on("data",p=>{l(p)}).on("error",p=>{console.warn("failed parsing graph",r,p.message),c(p)}).on("prefix",(p,g)=>{p&&(this.config.prefixes[p]=g)}).on("end",()=>{a(null)}),u.write(s),u.end()}else hy.parse(s,(u,p,g)=>{if(u)return console.warn("failed parsing graph",r,u.message),c(u);if(p){l(p);return}g&&this.config.registerPrefixes(g),a(null)})});try{await Promise.allSettled(o)}catch(a){console.warn(a)}};if(e instanceof Promise&&(e=await e),e){if(Bh(e)==="json")try{e=await uy.toRDF(JSON.parse(e),{format:"application/n-quads"})}catch(s){console.error(s)}await n(e)}}toURL(e){if(ec(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),ec(e)))return e}}return null}}async function ao(i){if(i in xl)return xl[i];const e=fetch(i,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then(t=>t.text());return xl[i]=e,e}function Bh(i){return/^\s*\{/.test(i)?"json":/^\s*<\?xml/.test(i)?"xml":"ttl"}function py(i){nc=i}class Sl{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 qh{constructor(e,t){this.attributes=new Sl,this.loader=new fy(this),this.prefixes={},this.editMode=!0,this.lists={},this.groups=[],this.renderedNodes=new Set,this._store=new jt,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 Sl;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=He.namedNode(t.valuesGraph))}static dataAttributes(){const e=new Sl;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)},qt,`${Oe}PropertyGroup`,null)}registerPrefixes(e){for(const t in e)t&&(this.prefixes[t]=e[t])}}function my(i){return"_:"+i.value}function gy(i,e){return[...i].map(t=>e(t)).join(`
343
368
  `)+`
344
- `}function ky(){return""}function Kf(i){return"<"+i.value+">"}const Iy=/["\\\\\n\r]/,Ry=/["\\\\\n\r]/g,Ty={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function $y(i){return Ty[i]}function Cy(i){return Iy.test(i)?i.replace(Ry,$y):i}function Ay(i){const e=Cy(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+'"^^'+Kf(i.datatype)}function Ny(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 Ly(i){return"?"+i.value}function Xt(i){if(!i)return null;if(i.termType==="BlankNode")return Ey(i);if(i.termType==="DefaultGraph")return ky();if(i.termType==="Literal")return Ay(i);if(i.termType==="NamedNode")return Kf(i);if(i.termType==="Quad"||i.subject&&i.predicate&&i.object&&i.graph)return Ny(i,Xt);if(i.termType==="Variable")return Ly(i);if(i[Symbol.iterator])return Sy(i,Xt);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(Xt(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(Xt(e));return t&&t.value}has(e){return this.index.has(Xt(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,t){const r=Xt(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 eh{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 th(i){try{return Xt(i)}catch{return null}}class ci{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=Xt(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return e?this.index.delete(th(e)):!1}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return e?this.index.has(th(e)):!1}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}let Jf=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};Jf.prototype.termType="BlankNode";let Tc=class{equals(e){return!!e&&e.termType===this.termType}};Tc.prototype.termType="DefaultGraph";Tc.prototype.value="";function ih(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 Fs=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}};Fs.prototype.termType="Literal";let ps=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};ps.prototype.termType="NamedNode";let $c=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)}};$c.prototype.termType="Quad";$c.prototype.value="";let Qf=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};Qf.prototype.termType="Variable";const Dy=new ps("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),rh=new ps("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),Oy=new ps("http://www.w3.org/2001/XMLSchema#string");let Xf=class{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new Tc}}namedNode(e){return new ps(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new Jf(e)}literal(e,t){return typeof t=="string"?new Fs(e,t,rh):typeof t?.language=="string"?new Fs(e,t.language,t.direction?Dy:rh,t.direction):new Fs(e,"",t||Oy)}variable(e){return new Qf(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,r,n=this.defaultGraph()){return new $c(e,t,r,n)}fromTerm(e){return ih(this,e)}fromQuad(e){return ih(this,e)}};Xf.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const Cc=new Xf,My={apply:(i,e,t)=>i(t[0]),get:(i,e)=>i(e)};function fi(i,{factory:e=Cc}={}){const t=(r="")=>e.namedNode(`${i}${r.raw||r}`);return typeof Proxy>"u"?t:new Proxy(t,My)}fi("http://www.w3.org/2001/XMLSchema#");const xi=fi("http://www.w3.org/1999/02/22-rdf-syntax-ns#");fi("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 eh({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]||xi.nil,o));for(let l=0;l<a.length;l++)e.dataset.add(e.factory.quad(a[l],xi.first,r[l],o)),e.dataset.add(e.factory.quad(a[l],xi.rest,a[l+1]||xi.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);!xi.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:!!(xi.nil.equals(e.term)||Ke.traverse({ptr:e,predicates:[xi.first]}).length===1)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(xi.nil);){const t=e.out([xi.first]);if(t.length!==1)throw new Error(`Invalid list: rdf:first count not equals one on ${e.value}`);const r=e.out([xi.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 ci(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 eh({dataset:e.dataset,end:r,quad:_,start:t}),e))}return c}}function nh(i,e){return e?t=>e(i.extend(t)):()=>{}}class sh{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:nh(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:nh(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 oh(i,e){return i?i.equals(e):i===e}function Py(i,e){return!(i.dataset!==e.dataset||!oh(i.graph,e.graph)||!oh(i.term,e.term))}function ah(i,e){return e?t=>e(new i.constructor({factory:i.factory,ptrs:[t]})):()=>{}}class Js{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 sh({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 ci(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?.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,t,r){const n=ah(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=ah(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=>Py(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 sh({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]})}}fi("http://www.w3.org/2002/07/owl#");const Ir=fi("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),jy=fi("http://www.w3.org/2000/01/rdf-schema#"),ae=fi("http://www.w3.org/ns/shacl#"),Al=fi("https://schemas.link/shacl-next#"),Ac=fi("http://www.w3.org/2001/XMLSchema#");function By(i){return i?`{${[...i.quads()].map(e=>Xt(e)).join(" ")}}`:"{}"}function Fy(i){return i?`{${i.map(e=>By(e)).join(" ")}}`:"{}"}var Ja,lh;function qy(){if(lh)return Ja;lh=1;var i=/\s/;function e(t){for(var r=t.length;r--&&i.test(t.charAt(r)););return r}return Ja=e,Ja}var Qa,ch;function Uy(){if(ch)return Qa;ch=1;var i=qy(),e=/^\s+/;function t(r){return r&&r.slice(0,i(r)+1).replace(e,"")}return Qa=t,Qa}var Xa,dh;function Vy(){if(dh)return Xa;dh=1;function i(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return Xa=i,Xa}var Ya,uh;function zy(){if(uh)return Ya;uh=1;var i=typeof Br=="object"&&Br&&Br.Object===Object&&Br;return Ya=i,Ya}var Za,hh;function Hy(){if(hh)return Za;hh=1;var i=zy(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=i||e||Function("return this")();return Za=t,Za}var el,fh;function Yf(){if(fh)return el;fh=1;var i=Hy(),e=i.Symbol;return el=e,el}var tl,ph;function Wy(){if(ph)return tl;ph=1;var i=Yf(),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 tl=s,tl}var il,mh;function Gy(){if(mh)return il;mh=1;var i=Object.prototype,e=i.toString;function t(r){return e.call(r)}return il=t,il}var rl,gh;function Ky(){if(gh)return rl;gh=1;var i=Yf(),e=Wy(),t=Gy(),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 rl=o,rl}var nl,yh;function Jy(){if(yh)return nl;yh=1;function i(e){return e!=null&&typeof e=="object"}return nl=i,nl}var sl,bh;function Qy(){if(bh)return sl;bh=1;var i=Ky(),e=Jy(),t="[object Symbol]";function r(n){return typeof n=="symbol"||e(n)&&i(n)==t}return sl=r,sl}var ol,vh;function Xy(){if(vh)return ol;vh=1;var i=Uy(),e=Vy(),t=Qy(),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 ol=l,ol}var al,wh;function Yy(){if(wh)return al;wh=1;var i=Xy(),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 al=r,al}var ll,_h;function Zy(){if(_h)return ll;_h=1;var i=Yy();function e(t){var r=i(t),n=r%1;return r===r?n?r-n:r:0}return ll=e,ll}var cl,xh;function eb(){if(xh)return cl;xh=1;var i=Zy(),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 cl=t,cl}var dl,Eh;function tb(){if(Eh)return dl;Eh=1;var i=eb();function e(t){return i(2,t)}return dl=e,dl}var ib=tb();const yi=Kp(ib);let Sh=class{constructor({details:e,factory:t,options:r,results:n=[]}={}){this.details=e,this.factory=t,this.options=r,this.results=n,this._conforms=yi(()=>!this.results.some(s=>s.severity.equals(ae.Info)||s.severity.equals(ae.Violation)||s.severity.equals(ae.Warning))),this._ptr=yi(()=>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 Js({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([Ir.type],[ae.ValidationReport]).addOut([ae.conforms],[this.factory.literal(this.conforms.toString(),Ac.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 rb(i,e){return Object.entries(e).reduce((t,[r,n])=>(n&&n.termType&&(n=Xt(n)),t.replace(`{$${r}}`,n).replace(`{?${r}}`,n)),i)}let nb=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=yi(()=>(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(rb(y.value,e),y.language||null))))}get message(){return this._message()}build(e,{details:t}={}){e.addOut([Ir.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 Nc{constructor({factory:e,focusNode:t,options:r={debug:!1,details:!1},processed:n=new Set,report:s=new Sh({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 Nc({factory:this.factory,focusNode:t,options:this.options,processed:this.processed,report:e?new Sh({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`${Xt(e.ptr.term)} - ${Xt(this.focusNode.term)} - ${Fy(this.valuePaths)}`}result(e){const t=new nb({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:Al.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:Al.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 sb(){return{generic:ob()}}function ob(){return i=>{i.trace(Al.TraversalConstraintComponent,{args:{},message:[i.factory.literal("Traversal")],value:i.valueOrNode})}}class ab{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(sb),[...n].map(s=>s(e)).filter(Boolean)}}var mr={},gr={},En={},kh;function Zf(){if(kh)return En;kh=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={},Ih;function ep(){if(Ih)return kn;Ih=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={},Rh;function Lc(){if(Rh)return Rn;Rh=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 Th;function tp(){if(Th)return In;Th=1,Object.defineProperty(In,"__esModule",{value:!0}),In.Literal=void 0;const i=Lc();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={},$h;function ip(){if($h)return Tn;$h=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={},Ch;function rp(){if(Ch)return $n;Ch=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 Ah;function lb(){if(Ah)return Sn;Ah=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.DataFactory=void 0;const i=Zf(),e=ep(),t=tp(),r=Lc(),n=ip(),s=rp();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 Nh;function cb(){return Nh||(Nh=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(Zf(),i),t(lb(),i),t(ep(),i),t(tp(),i),t(Lc(),i),t(ip(),i),t(rp(),i)}(gr)),gr}var yr={},Cn={},An={},Lh;function Qr(){if(Lh)return An;Lh=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 Dh;function db(){if(Dh)return Cn;Dh=1,Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.TypeHandlerBoolean=void 0;const i=Qr();let e=class np{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(np.TYPE))}};return Cn.TypeHandlerBoolean=e,e.TYPE="http://www.w3.org/2001/XMLSchema#boolean",Cn}var Nn={},Oh;function ub(){if(Oh)return Nn;Oh=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.TypeHandlerDate=void 0;const i=Qr();let e=class Nl{fromRdf(r,n){switch(n&&!r.value.match(Nl.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(Nl.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={},Mh;function hb(){if(Mh)return Ln;Mh=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.TypeHandlerNumberDouble=void 0;const i=Qr();let e=class sp{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(sp.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={},Ph;function fb(){if(Ph)return Dn;Ph=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.TypeHandlerNumberInteger=void 0;const i=Qr();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={},jh;function pb(){if(jh)return On;jh=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 Bh;function Fh(){return Bh||(Bh=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(db(),i),t(ub(),i),t(hb(),i),t(fb(),i),t(pb(),i)}(yr)),yr}var ul={},qh;function mb(){return qh||(qh=1,Object.defineProperty(ul,"__esModule",{value:!0})),ul}var Uh;function gb(){return Uh||(Uh=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=cb(),n=Fh(),s=Qr();t(Fh(),i),t(mb(),i),t(Qr(),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 ns=gb();function Vh(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 yb(i){return i.terms.length===0?null:i.ptrs[0].isList()?[...i.list()].map(e=>Vh(e)):[Vh(i)]}class bb{constructor(e){this.shape=e,this._compiled=yi(()=>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 ci(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 Ll(i){const e=new ci,r=new Js({dataset:i.dataset,terms:i.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[jy.subClassOf]});for(const n of r.ptrs)for(const{term:s}of n.nodes())e.add(s);return e}class vb{constructor(e){this.targetClass=new ci([...Ll(e.hasOut([Ir.type],[ae.NodeShape])),...Ll(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([Ir.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 ci(n.terms)])}}class wb{constructor(e,{validator:t}){this.ptr=e,this.validator=t,this._deactivated=yi(()=>{const r=this.ptr.out([ae.deactivated]).term;return r&&ns.fromRdf(r)}),this._message=yi(()=>this.ptr.out([ae.message]).terms),this._path=yi(()=>yb(this.ptr.out([ae.path]))),this._severity=yi(()=>this.ptr.out([ae.severity]).term),this._shapeValidator=yi(()=>new bb(this)),this._sparql=yi(()=>this.ptr.out([ae.sparql])),this._targetResolver=yi(()=>new vb(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 _b(i){const e=parseInt(i.ptr.out([ae.maxCount]).value);return{property:xb(e)}}function xb(i){return e=>{e.test(e.values.terms.length<=i,ae.MaxCountConstraintComponent,{args:{maxCount:i},message:[e.factory.literal("More than {$maxCount} values")]})}}function Eb(i){const e=parseInt(i.ptr.out([ae.minCount]).value);return{property:Sb(e)}}function Sb(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 kb(i,e){for(const t of i)if(!await e(t))return!1;return!0}async function Ib(i,e){return(await Promise.all(i.map(t=>e(t)))).filter(Boolean)}async function yo(i,e){return Promise.all(i.map(e))}async function Rb(i,e){for(const t of i)if(await e(t))return!0;return!1}function Tb(i){const e=[...i.ptr.out([ae.and])].flatMap(t=>[...t.list()]).map(t=>i.validator.shape(t));return{generic:$b(e)}}function $b(i){return async e=>{const t=await yo(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 Cb(i){const e=i.validator.shape(i.ptr.out([ae.not]));return{generic:Ab(e)}}function Ab(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 Nb(i){const e=[...i.ptr.out([ae.or])].flatMap(t=>[...t.list()]).map(t=>i.validator.shape(t));return{generic:Lb(e)}}function Lb(i){return async e=>{let t=[],r;if(e.options.debug||e.options.details){const n=await yo(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 Rb(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 Db(i){const e=[...i.ptr.out([ae.xone])].flatMap(t=>[...t.list()]).map(t=>i.validator.shape(t));return{generic:Ob(e)}}function Ob(i){return async e=>{const t=await yo(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 Mb(i){if(!ns.fromRdf(i.ptr.out([ae.closed]).term))return null;const t=i.ptr.out([ae.property]).map(s=>i.validator.shape(s)),r=new ci(t.filter(s=>!s.deactivated).map(s=>s.path[0].predicates[0])),n=new ci([...i.ptr.out([ae.ignoredProperties]).list()||[]].map(s=>s.term));return{node:Pb(r,n)}}function Pb(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 jb(i){const e=i.ptr.out([ae.hasValue]).term;return{node:Bb(e),property:Fb(e)}}function Bb(i){return e=>{e.test(i.equals(e.valueOrNode.term),ae.HasValueConstraintComponent,{args:{hasValue:i},message:[e.factory.literal("Value must be {$hasValue}")]})}}function Fb(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 qb(i){const e=new ci([...i.ptr.out([ae.in]).list()].map(t=>t.term));return{generic:Ub(e)}}function Ub(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"||zh(i)!==zh(e))return null;const t=ns.fromRdf(i),r=ns.fromRdf(e);return typeof t!=typeof r?null:typeof t=="string"?t.localeCompare(r):t-r}function zh(i){const e=/^.*(((\+|-)\d{2}:\d{2})|Z)$/;return Ac.dateTime.equals(i.datatype)&&e.test(i.value)}function Vb(i){const e=i.ptr.out([ae.disjoint]).term;return{generic:zb(e)}}function zb(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 Hb(i){const e=i.ptr.out([ae.equals]).term;return{node:Wb(e),property:Gb(e)}}function Wb(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 Gb(i){return e=>{const t=new ci(e.focusNode.out([i]).terms),r=new ci(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 Kb(i){const e=i.ptr.out([ae.lessThan]).term;return{property:Jb(e)}}function Jb(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 Qb(i){const e=i.ptr.out([ae.lessThanOrEquals]).term;return{property:Xb(e)}}function Xb(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 Yb(i){const e=i.ptr.out([ae.maxExclusive]).term;return{generic:Zb(e)}}function Zb(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 ev(i){const e=i.ptr.out([ae.maxInclusive]).term;return{generic:tv(e)}}function tv(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 iv(i){const e=i.ptr.out([ae.minExclusive]).term;return{generic:rv(e)}}function rv(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 nv(i){const e=i.ptr.out([ae.minInclusive]).term;return{generic:sv(e)}}function sv(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 ov(i){const e=[...i.ptr.out([ae.node])].map(t=>i.validator.shape(t));return{generic:av(e)}}function av(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 lv(i){const e=[...i.ptr.out([ae.property])].map(t=>i.validator.shape(t));return{generic:cv(e)}}function cv(i){return async e=>{const t=e.create({focusNode:e.valueOrNode});for(const r of i)await r.validate(t)}}function dv(i){const e=i.validator.shape(i.ptr.out([ae.qualifiedValueShape])),t=i.ptr.out([ae.qualifiedValueShapesDisjoint]).term,r=t?ns.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:uv(e,r,s,a)}}function uv(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 Ib(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 yo([...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 kb([...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 hv(i,e){return e?e.slice(0,i.length)===i:!1}function fv(i){const e=[...new Set([...i.ptr.out([ae.languageIn]).list()].map(t=>t.value))];return{generic:pv(e)}}function pv(i){return e=>{const t=i.some(r=>hv(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 mv(i){const e=parseInt(i.ptr.out([ae.maxLength]).value);return{generic:gv(e)}}function gv(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 yv(i){const e=parseInt(i.ptr.out([ae.minLength]).value);return{generic:bv(e)}}function bv(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 vv(i){const e=i.ptr.out([ae.pattern]).value,t=i.ptr.out([ae.flags]).value,r=new RegExp(e,t);return{generic:wv(e,t,r)}}function wv(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 _v(i){const e=i.ptr.out([ae.uniqueLang]).term;return e.value==="true"&&Ac.boolean.equals(e.datatype)?{property:xv()}:null}function xv(){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 qs=fi("http://www.w3.org/ns/shacl#"),op=fi("https://schemas.link/shacl-next#");class Xr{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some(e=>e.severity.equals(qs.Info)||e.severity.equals(qs.Violation)||e.severity.equals(qs.Warning))}}function Ev(i,e){return Object.entries(e).reduce((t,[r,n])=>(n&&n.termType&&(n=Xt(n)),t.replace(`{$${r}}`,n).replace(`{?${r}}`,n)),i)}class Qs{constructor({args:e={},factory:t,message:r=[],severity:n=qs.Violation}={}){this.severity=n,this.message=r.map(s=>t.literal(Ev(s.value,e),s.language||null))}}class Dc{constructor({factory:e=Cc}={}){this.factory=e}clone({factory:e}={}){return new Dc({factory:e||this.factory})}validate(){return new Xr}validateSimple(){return!0}}class dn extends Dc{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 Sv{constructor({factory:e=Cc,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 Xr}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=op.Debug);const s={pattern:this.factory.literal(r.toString()),this:e};return new Qs({args:s,factory:this.factory,message:this.message,severity:n})});return new Xr({results:t})}validateSimple(e){return this.patterns.every(t=>t.test(e.value))}}const kv=/^([-+]?[0-9]+)$/;class Bt extends Ze{constructor(e=null,t=null,r,{factory:n}={}){super(kv,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}={}){return new Bt(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const t=super.validate(e).results;if(!op.Debug.equals(t[0].severity))return new Xr({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 Qs({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 Qs({factory:this.factory,message:s}))}return new Xr({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 Oc extends dn{constructor(e,t,{factory:r}={}){super({datatypes:t,factory:r}),this.values=new Set(e)}clone({factory:e}={}){return new Oc(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 Qs({factory:this.factory,message:n}))}return new Xr({results:t})}validateSimple(e){return this.values.has(e.value)}}const qe={xsd:fi("http://www.w3.org/2001/XMLSchema#")},Iv=new dn({datatypes:qe.xsd.anySimpleType}),Rv=new dn({datatypes:qe.xsd.anyAtomicType}),bo=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,Tv=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,ap=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,Mc=/^(-?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)))))$/,lp=/^(-?([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))?)$/,$v=/^((([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))?)$/,Cv=/^(-?([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))?)$/,Av=/^(-?([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))?)$/,Nv=/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Lv=/^(--(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))?)$/,Dv=/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Ov=/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Mv=/^(([0-9a-fA-F]{2})*)$/,Pv=/^(((([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] ?= ?=))?)$/,jv=new Ze(bo,qe.xsd.string),Bv=new Oc(["1","true","0","false"],qe.xsd.boolean),Fv=new Ze(Tv,qe.xsd.decimal),qv=new Ze(ap,qe.xsd.float),Uv=new Ze(ap,qe.xsd.double),Vv=new Ze(Mc,qe.xsd.duration),zv=new Ze(lp,qe.xsd.dateTime),Hv=new Ze($v,qe.xsd.time),Wv=new Ze(Cv,qe.xsd.date),Gv=new Ze(Av,qe.xsd.gYearMonth),Kv=new Ze(Nv,qe.xsd.gYear),Jv=new Ze(Lv,qe.xsd.gMonthDay),Qv=new Ze(Dv,qe.xsd.gDay),Xv=new Ze(Ov,qe.xsd.gMonth),Yv=new Ze(Mv,qe.xsd.hexBinary),Zv=new Ze(Pv,qe.xsd.base64Binary),e0=new Ze(bo,qe.xsd.anyURI),cp=/^([^\u000d\u000a\u0009]*)$/,t0=/^([^ ]+( [^ ]+)*)*$/,i0=/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,r0=/^([^DT]*)$/,n0=/^([^YM]*[DT].*)$/,s0=/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/,o0=new Ze([bo,cp],qe.xsd.normalizedString),a0=new Ze([bo,cp,t0],qe.xsd.token),l0=new Ze(i0,qe.xsd.language),c0=new Bt(null,null,qe.xsd.integer),d0=new Bt(null,"0",qe.xsd.nonPositiveInteger),u0=new Bt(null,"-1",qe.xsd.negativeInteger),h0=new Bt("-9223372036854775808","9223372036854775807",qe.xsd.long),f0=new Bt("-2147483648","2147483647",qe.xsd.int),p0=new Bt("-32768","32767",qe.xsd.short),m0=new Bt("-128","127",qe.xsd.byte),g0=new Bt("0",null,qe.xsd.nonNegativeInteger),y0=new Bt("0","18446744073709551615",qe.xsd.unsignedLong),b0=new Bt("0","4294967295",qe.xsd.unsignedInt),v0=new Bt("0","65535",qe.xsd.unsignedShort),w0=new Bt("0","255",qe.xsd.unsignedByte),_0=new Bt("1",null,qe.xsd.positiveInteger),x0=new Ze([Mc,r0],qe.xsd.yearMonthDuration),E0=new Ze([Mc,n0],qe.xsd.dayTimeDuration),S0=new Ze([lp,s0],qe.xsd.dateTimeStamp),k0=Object.freeze(Object.defineProperty({__proto__:null,anyAtomicType:Rv,anySimpleType:Iv,anyURI:e0,base64Binary:Zv,boolean:Bv,byte:m0,date:Wv,dateTime:zv,dateTimeStamp:S0,dayTimeDuration:E0,decimal:Fv,double:Uv,duration:Vv,float:qv,gDay:Qv,gMonth:Xv,gMonthDay:Jv,gYear:Kv,gYearMonth:Gv,hexBinary:Yv,int:f0,integer:c0,language:l0,long:h0,negativeInteger:u0,nonNegativeInteger:g0,nonPositiveInteger:d0,normalizedString:o0,positiveInteger:_0,short:p0,string:jv,time:Hv,token:a0,unsignedByte:w0,unsignedInt:b0,unsignedLong:y0,unsignedShort:v0,yearMonthDuration:x0},Symbol.toStringTag,{value:"Module"}));class I0 extends Sv{constructor({factory:e}={}){super({factory:e,validations:{...k0}})}}const R0=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 T0(i){const e=i.ptr.out([ae.class]).map(t=>Ll(t));return{generic:$0(e)}}function $0(i){return e=>{const t=new ci(e.valueOrNode.out([Ir.type]).terms);for(const r of i){const n=[...t].some(s=>r.has(s));e.test(n,ae.ClassConstraintComponent,{value:e.valueOrNode})}}}function C0(i){const e=i.ptr.out([ae.datatype]).term,t=new I0;return{generic:A0(e,t)}}function A0(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 N0(i){const e=i.ptr.out([ae.nodeKind]).term,t=R0.get(e);return{generic:L0(e,t)}}function L0(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 D0=new ln([[ae.maxCount,_b],[ae.minCount,Eb],[ae.and,Tb],[ae.not,Cb],[ae.or,Nb],[ae.xone,Db],[ae.closed,Mb],[ae.hasValue,jb],[ae.in,qb],[ae.disjoint,Vb],[ae.equals,Hb],[ae.lessThan,Kb],[ae.lessThanOrEquals,Qb],[ae.maxExclusive,Yb],[ae.maxInclusive,ev],[ae.minExclusive,iv],[ae.minInclusive,nv],[ae.node,ov],[ae.property,lv],[ae.qualifiedValueShape,dv],[ae.languageIn,fv],[ae.maxLength,mv],[ae.minLength,yv],[ae.pattern,vv],[ae.uniqueLang,_v],[ae.class,T0],[ae.datatype,C0],[ae.nodeKind,N0]]);class O0{constructor(e,{factory:t,...r}){if(this.factory=t,this.options=r,this.registry=new ab(D0),this.shapesPtr=new Js({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([Ir.type],[ae.NodeShape]),...this.shapesPtr.hasOut([Ir.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 wb(e,{validator:this}),this.shapes.set(e.term,t)),t}async validate(e,t){const r=new Js({...e,factory:this.factory}),n=new Nc({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 M0=class extends HTMLElement{constructor(e){super(),this.shape=null,this.attachShadow({mode:"open"}),this.form=document.createElement("form"),this.config=new Zu(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 Zu.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 Hm())r.stylesheet&&t.push(r.stylesheet);if(this.shadowRoot.adoptedStyleSheets=t,this.shape=new ir(e,this.config,this.config.attributes.valuesSubject?Fe.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=>{if(s?.conforms)this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0}));else{let o=this.form.querySelector(":scope .invalid > .editor");o?o.focus():this.form.querySelector(":scope .invalid")?.scrollIntoView()}})}),this.form.appendChild(r)}this.config.attributes.valuesSubject&&this.removeFromDataGraph(Fe.namedNode(this.config.attributes.valuesSubject)),await this.validate(!0)}}else if(this.config.store.countQuads(null,null,null,zs)>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 qm(r,e,this.config.prefixes)}toRDF(e=new It){return this.shape?.toRDF(e),e}registerPlugin(e){zm(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setSharedShapesGraph(e){xy(e),this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}async validate(e=!1){for(const t of this.form.querySelectorAll(":scope .validation-error"))t.remove();for(const t of this.form.querySelectorAll(":scope .property-instance"))t.classList.remove("invalid"),t.querySelector(":scope > .editor")?.value?t.classList.add("valid"):t.classList.remove("valid");this.config.store.deleteGraph(this.config.valuesGraphId||""),this.shape?.toRDF(this.config.store),this.shape&&this.config.store.add(new oo(this.shape.shaclSubject,Fe.namedNode(Ae+"targetNode"),this.shape.nodeId,this.config.valuesGraphId));try{const t=this.config.store,r=await new O0(t,{details:!0,factory:Fe}).validate({dataset:t});for(const n of r.results)if(n.focusNode?.ptrs?.length)for(const s of n.focusNode.ptrs){const o=s._term;if(n.path?.length){const a=n.path[0].predicates[0];let l=this.form.querySelectorAll(`
369
+ `}function by(){return""}function Pp(i){return"<"+i.value+">"}const yy=/["\\\\\n\r]/,vy=/["\\\\\n\r]/g,wy={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function _y(i){return wy[i]}function xy(i){return yy.test(i)?i.replace(vy,_y):i}function Ey(i){const e=xy(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+'"^^'+Pp(i.datatype)}function Sy(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 ky(i){return"?"+i.value}function ci(i){if(!i)return null;if(i.termType==="BlankNode")return my(i);if(i.termType==="DefaultGraph")return by();if(i.termType==="Literal")return Ey(i);if(i.termType==="NamedNode")return Pp(i);if(i.termType==="Quad"||i.subject&&i.predicate&&i.object&&i.graph)return Sy(i,ci);if(i.termType==="Variable")return ky(i);if(i[Symbol.iterator])return gy(i,ci);throw new Error(`unknown termType ${i.termType}`)}class An{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(ci(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(ci(e));return t&&t.value}has(e){return this.index.has(ci(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,t){const r=ci(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 Uh{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 Vh(i){try{return ci(i)}catch{return null}}class wi{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=ci(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return e?this.index.delete(Vh(e)):!1}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return e?this.index.has(Vh(e)):!1}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}class Mp{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Mp.prototype.termType="BlankNode";class rd{equals(e){return!!e&&e.termType===this.termType}}rd.prototype.termType="DefaultGraph";rd.prototype.value="";function zh(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}`)}class yo{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}}yo.prototype.termType="Literal";class qs{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}qs.prototype.termType="NamedNode";class nd{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)}}nd.prototype.termType="Quad";nd.prototype.value="";class Fp{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Fp.prototype.termType="Variable";const Ry=new qs("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),Hh=new qs("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),Iy=new qs("http://www.w3.org/2001/XMLSchema#string");class jp{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new rd}}namedNode(e){return new qs(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new Mp(e)}literal(e,t){return typeof t=="string"?new yo(e,t,Hh):typeof t?.language=="string"?new yo(e,t.language,t.direction?Ry:Hh,t.direction):new yo(e,"",t||Iy)}variable(e){return new Fp(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,r,n=this.defaultGraph()){return new nd(e,t,r,n)}fromTerm(e){return zh(this,e)}fromQuad(e){return zh(this,e)}}jp.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const sd=new jp,Ty={apply:(i,e,t)=>i(t[0]),get:(i,e)=>i(e)};function Si(i,{factory:e=sd}={}){const t=(r="")=>e.namedNode(`${i}${r.raw||r}`);return typeof Proxy>"u"?t:new Proxy(t,Ty)}Si("http://www.w3.org/2001/XMLSchema#");const Li=Si("http://www.w3.org/1999/02/22-rdf-syntax-ns#");Si("http://www.w3.org/2000/01/rdf-schema#");class rt{static add({ptr:e,start:t,end:r,subjects:n=[null],predicates:s=[null],objects:o=[null],graphs:a,callback:c}={}){if(!e.factory)throw new Error("add operation requires a factory");let l=()=>{};c&&(l=d=>{c(new Uh({dataset:e.dataset,start:t,end:r,quad:d}))});for(const d of n)for(const u of s)for(const p of o)for(const g of a){const v={subject:d,predicate:u,object:p,graph:g};v[t]=e.term;const _=e.factory.quad(v.subject,v.predicate,v.object,v.graph);e.dataset.add(_),l(_)}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]||Li.nil,o));for(let c=0;c<a.length;c++)e.dataset.add(e.factory.quad(a[c],Li.first,r[c],o)),e.dataset.add(e.factory.quad(a[c],Li.rest,a[c+1]||Li.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 c of s){const l={subject:o,predicate:a,object:c};l[t]=e.term;const d=e.dataset.match(l.subject,l.predicate,l.object);for(const u of d)e.dataset.delete(u)}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);!Li.nil.equals(o);){o=r[r.length-1].object;const a=e.dataset.match(o);if(a.size===0)break;for(const c of a)r.push(c)}}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:c,graphs:l,items:d,callback:u}={}){if(t==="add")return rt.add({ptr:e,start:n,end:s,subjects:o,predicates:a,objects:c,graphs:l,callback:u});if(t==="addList")return rt.addList({ptr:e,predicates:a,items:d,graphs:l});if(t==="delete")return rt.delete({ptr:e,start:n,subjects:o,predicates:a,objects:c});if(t==="deleteList")return rt.deleteList({ptr:e,predicates:a});if(t==="isList")return rt.isList({ptr:e});if(t==="list")return rt.list({ptr:e});if(t==="traverse")return rt.traverse({ptr:e,quantifier:r,start:n,end:s,subjects:o,predicates:a,objects:c,graphs:l});throw new Error(`unknown operation ${t}`)}static isList({ptr:e}){return e.isAny()?!1:!!(Li.nil.equals(e.term)||rt.traverse({ptr:e,predicates:[Li.first]}).length===1)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(Li.nil);){const t=e.out([Li.first]);if(t.length!==1)throw new Error(`Invalid list: rdf:first count not equals one on ${e.value}`);const r=e.out([Li.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:c=[null],callback:l}){if(t==="one")return rt.traverseOne({ptr:e,start:r,end:n,subjects:s,predicates:o,objects:a,graphs:c,callback:l});if(t==="oneOrMore"){const d=rt.traverse({ptr:e,end:n,start:r,subjects:s,predicates:o,objects:a,graphs:c,callback:l});return rt.traverseMore({ptrs:d,end:n,start:r,subjects:s,predicates:o,objects:a,graphs:c,callback:l})}if(t==="zeroOrMore")return rt.traverseMore({ptrs:[e],end:n,start:r,subjects:s,predicates:o,objects:a,graphs:c,callback:l});if(t==="zeroOrOne")return[e,...rt.traverse({ptr:e,end:n,start:r,subjects:s,predicates:o,objects:a,graphs:c,callback:l})];throw new Error(`unknown quantifier ${t}`)}static traverseMore({ptrs:e,end:t,start:r,subjects:n,predicates:s,objects:o,graphs:a,callback:c}={}){let l=[...e],d,u;do{d=[];for(const p of e)d=[...d,...rt.traverseOne({ptr:p,end:t,start:r,subjects:n,predicates:s,objects:o,graphs:a,callback:c})];u&&(d=d.filter(p=>!u.has(p.term))),e=d,l=[...l,...d],u=new wi(l.map(p=>p.term))}while(d.length>0);return l}static traverseOne({ptr:e,start:t,end:r,subjects:n,predicates:s,objects:o,graphs:a,callback:c=(l,d)=>d.extend(l)}={}){const l=[];for(const d of n)for(const u of s)for(const p of o)for(const g of a){const v={subject:d,predicate:u,object:p,graph:g};v[t]=e.term;for(const _ of e.dataset.match(v.subject,v.predicate,v.object,v.graph))l.push(c(new Uh({dataset:e.dataset,end:r,quad:_,start:t}),e))}return l}}function Wh(i,e){return e?t=>e(i.extend(t)):()=>{}}class Gh{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 rt.add({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:Wh(this,r)})}addList(e,t){return rt.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:t})}addOut(e,t,r){return rt.add({ptr:this,start:"subject",end:"object",predicates:e,objects:t,graphs:[this.graph||this.factory.defaultGraph()],callback:Wh(this,r)})}deleteIn(e,t){return rt.delete({ptr:this,start:"object",subjects:t,predicates:e})}deleteList(e){return rt.deleteList({ptr:this,predicates:e})}deleteOut(e,t){return rt.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:c,items:l,callback:d}){return rt.execute({ptr:this,operation:e,quantifier:t,start:r,end:n,subjects:s,predicates:o,objects:a,graphs:c,items:l,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 rt.traverse({ptr:this,start:"object",end:"object",subjects:t,predicates:e,graphs:[this.graph]})}hasOut(e,t){return rt.traverse({ptr:this,start:"subject",end:"subject",predicates:e,objects:t,graphs:[this.graph]})}in(e,t){return rt.traverse({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return rt.isList({ptr:this})}list(){return rt.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 rt.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 Kh(i,e){return i?i.equals(e):i===e}function Cy(i,e){return!(i.dataset!==e.dataset||!Kh(i.graph,e.graph)||!Kh(i.term,e.term))}function Xh(i,e){return e?t=>e(new i.constructor({factory:i.factory,ptrs:[t]})):()=>{}}class Io{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 Gh({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 wi(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?.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,t,r){const n=Xh(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=Xh(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=>Cy(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 Gh({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]})}}Si("http://www.w3.org/2002/07/owl#");const zr=Si("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),$y=Si("http://www.w3.org/2000/01/rdf-schema#"),de=Si("http://www.w3.org/ns/shacl#"),sc=Si("https://schemas.link/shacl-next#"),od=Si("http://www.w3.org/2001/XMLSchema#");function Ay(i){return i?`{${[...i.quads()].map(e=>ci(e)).join(" ")}}`:"{}"}function Ny(i){return i?`{${i.map(e=>Ay(e)).join(" ")}}`:"{}"}var kl,Jh;function Dy(){if(Jh)return kl;Jh=1;var i=/\s/;function e(t){for(var r=t.length;r--&&i.test(t.charAt(r)););return r}return kl=e,kl}var Rl,Qh;function Ly(){if(Qh)return Rl;Qh=1;var i=Dy(),e=/^\s+/;function t(r){return r&&r.slice(0,i(r)+1).replace(e,"")}return Rl=t,Rl}var Il,Yh;function Oy(){if(Yh)return Il;Yh=1;function i(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return Il=i,Il}var Tl,Zh;function Py(){if(Zh)return Tl;Zh=1;var i=typeof cn=="object"&&cn&&cn.Object===Object&&cn;return Tl=i,Tl}var Cl,ef;function My(){if(ef)return Cl;ef=1;var i=Py(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=i||e||Function("return this")();return Cl=t,Cl}var $l,tf;function Bp(){if(tf)return $l;tf=1;var i=My(),e=i.Symbol;return $l=e,$l}var Al,rf;function Fy(){if(rf)return Al;rf=1;var i=Bp(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,n=i?i.toStringTag:void 0;function s(o){var a=t.call(o,n),c=o[n];try{o[n]=void 0;var l=!0}catch{}var d=r.call(o);return l&&(a?o[n]=c:delete o[n]),d}return Al=s,Al}var Nl,nf;function jy(){if(nf)return Nl;nf=1;var i=Object.prototype,e=i.toString;function t(r){return e.call(r)}return Nl=t,Nl}var Dl,sf;function By(){if(sf)return Dl;sf=1;var i=Bp(),e=Fy(),t=jy(),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 Dl=o,Dl}var Ll,of;function qy(){if(of)return Ll;of=1;function i(e){return e!=null&&typeof e=="object"}return Ll=i,Ll}var Ol,af;function Uy(){if(af)return Ol;af=1;var i=By(),e=qy(),t="[object Symbol]";function r(n){return typeof n=="symbol"||e(n)&&i(n)==t}return Ol=r,Ol}var Pl,lf;function Vy(){if(lf)return Pl;lf=1;var i=Ly(),e=Oy(),t=Uy(),r=NaN,n=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;function c(l){if(typeof l=="number")return l;if(t(l))return r;if(e(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=e(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=i(l);var u=s.test(l);return u||o.test(l)?a(l.slice(2),u?2:8):n.test(l)?r:+l}return Pl=c,Pl}var Ml,cf;function zy(){if(cf)return Ml;cf=1;var i=Vy(),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 Ml=r,Ml}var Fl,df;function Hy(){if(df)return Fl;df=1;var i=zy();function e(t){var r=i(t),n=r%1;return r===r?n?r-n:r:0}return Fl=e,Fl}var jl,uf;function Wy(){if(uf)return jl;uf=1;var i=Hy(),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 jl=t,jl}var Bl,hf;function Gy(){if(hf)return Bl;hf=1;var i=Wy();function e(t){return i(2,t)}return Bl=e,Bl}var Ky=Gy();const Ci=Tm(Ky);let ff=class{constructor({details:e,factory:t,options:r,results:n=[]}={}){this.details=e,this.factory=t,this.options=r,this.results=n,this._conforms=Ci(()=>!this.results.some(s=>s.severity.equals(de.Info)||s.severity.equals(de.Violation)||s.severity.equals(de.Warning))),this._ptr=Ci(()=>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 Io({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([zr.type],[de.ValidationReport]).addOut([de.conforms],[this.factory.literal(this.conforms.toString(),od.boolean)]);for(const t of this.results)e.addOut([de.result],[this.factory.blankNode()],r=>{t.build(r,this.options)});return e}coverage(){return this.results.flatMap(e=>e.coverage())}};function Xy(i,e){return Object.entries(e).reduce((t,[r,n])=>(n&&n.termType&&(n=ci(n)),t.replace(`{$${r}}`,n).replace(`{?${r}}`,n)),i)}let Jy=class{constructor({args:e={},constraintComponent:t,factory:r,focusNode:n,message:s=[],path:o,results:a=[],severity:c,shape:l,source:d=[],value:u,valuePaths:p=[]}={}){this.args=e,this.constraintComponent=t,this.factory=r,this.focusNode=n,this.path=o||l.path,this.results=a,this.severity=c,this.shape=l,this.source=d,this.value=u,this.valuePaths=p,this._message=Ci(()=>(this.shape.message.length>0&&(s=this.shape.message),s.length===0&&(s=this.shape.ptr.node([this.constraintComponent]).out([de.message]).terms),s.map(g=>r.literal(Xy(g.value,e),g.language||null))))}get message(){return this._message()}build(e,{details:t}={}){e.addOut([zr.type],[de.ValidationResult]).addOut([de.focusNode],this.focusNode.terms).addOut([de.resultSeverity],[this.severity]).addOut([de.sourceConstraint],this.source).addOut([de.sourceConstraintComponent],[this.constraintComponent]).addOut([de.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([de.resultMessage],this.message);const r=n=>{if(n.quantifier==="one")return n.predicates.length>1?e.node([this.factory.blankNode()]).addList([de.alternativePath],n.predicates):n.start==="object"?e.node([this.factory.blankNode()]).addOut([de.inversePath],[n.predicates[0]]):e.node([n.predicates[0]]);if(n.quantifier==="oneOrMore")return e.node([this.factory.blankNode()]).addOut([de.oneOrMorePath],[n.predicates[0]]);if(n.quantifier==="zeroOrMore")return e.node([this.factory.blankNode()]).addOut([de.zeroOrMorePath],[n.predicates[0]]);if(n.quantifier==="zeroOrOne")return e.node([this.factory.blankNode()]).addOut([de.zeroOrOnePath],[n.predicates[0]])};if(this.path&&(this.path.length===1?e.addOut([de.resultPath],r(this.path[0]).terms):e.addList([de.resultPath],this.path.map(n=>r(n).term))),typeof this.value<"u"&&e.addOut([de.value],this.value.terms),t)for(const n of this.results)e.addOut([de.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 ad{constructor({factory:e,focusNode:t,options:r={debug:!1,details:!1},processed:n=new Set,report:s=new ff({factory:e,options:r}),results:o=new Map,shape:a,value:c,valueOrNode:l,valuePaths:d,values:u}={}){this.factory=e,this.focusNode=t,this.options=r,this.processed=n,this.report=s,this.results=o,this.shape=a,this.value=c,this.valuePaths=d,this.valueOrNode=l,this.values=u}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 ad({factory:this.factory,focusNode:t,options:this.options,processed:this.processed,report:e?new ff({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`${ci(e.ptr.term)} - ${ci(this.focusNode.term)} - ${Ny(this.valuePaths)}`}result(e){const t=new Jy({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:sc.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:sc.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||de.Violation,...t})}}function Qy(){return{generic:Yy()}}function Yy(){return i=>{i.trace(sc.TraversalConstraintComponent,{args:{},message:[i.factory.literal("Traversal")],value:i.valueOrNode})}}class Zy{constructor(e){this.validations=new An(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(de.property)&&(r=!0))}return t&&e.isPropertyShape&&!r&&n.add(Qy),[...n].map(s=>s(e)).filter(Boolean)}}var Or={},Pr={},rs={},ns={},pf;function wn(){if(pf)return ns;pf=1,Object.defineProperty(ns,"__esModule",{value:!0}),ns.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 ns.Translator=i,ns}var mf;function e0(){if(mf)return rs;mf=1,Object.defineProperty(rs,"__esModule",{value:!0}),rs.TypeHandlerBoolean=void 0;const i=wn();let e=class qp{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(qp.TYPE))}};return rs.TypeHandlerBoolean=e,e.TYPE="http://www.w3.org/2001/XMLSchema#boolean",rs}var ss={},gf;function t0(){if(gf)return ss;gf=1,Object.defineProperty(ss,"__esModule",{value:!0}),ss.TypeHandlerDate=void 0;const i=wn();let e=class oc{fromRdf(r,n){switch(n&&!r.value.match(oc.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(oc.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 ss.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]$/},ss}var os={},bf;function i0(){if(bf)return os;bf=1,Object.defineProperty(os,"__esModule",{value:!0}),os.TypeHandlerNumberDouble=void 0;const i=wn();let e=class Up{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(Up.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 os.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"],os}var as={},yf;function r0(){if(yf)return as;yf=1,Object.defineProperty(as,"__esModule",{value:!0}),as.TypeHandlerNumberInteger=void 0;const i=wn();let e=class ps{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<=ps.MAX_INT&&r>=ps.MIN_INT?s.namedNode(ps.TYPES[0]):s.namedNode(ps.TYPES[1])))}};return as.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,as}var ls={},vf;function n0(){if(vf)return ls;vf=1,Object.defineProperty(ls,"__esModule",{value:!0}),ls.TypeHandlerString=void 0;let i=class{fromRdf(t){return t.value}toRdf(t,{datatype:r,dataFactory:n}){return n.literal(t,r)}};return ls.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"],ls}var wf;function _f(){return wf||(wf=1,function(i){var e=Pr&&Pr.__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=Pr&&Pr.__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(e0(),i),t(t0(),i),t(i0(),i),t(r0(),i),t(n0(),i)}(Pr)),Pr}var ql={},xf;function s0(){return xf||(xf=1,Object.defineProperty(ql,"__esModule",{value:!0})),ql}var Ef;function o0(){return Ef||(Ef=1,function(i){var e=Or&&Or.__createBinding||(Object.create?function(g,v,_,E){E===void 0&&(E=_);var x=Object.getOwnPropertyDescriptor(v,_);(!x||("get"in x?!v.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return v[_]}}),Object.defineProperty(g,E,x)}:function(g,v,_,E){E===void 0&&(E=_),g[E]=v[_]}),t=Or&&Or.__exportStar||function(g,v){for(var _ in g)_!=="default"&&!Object.prototype.hasOwnProperty.call(v,_)&&e(v,g,_)};Object.defineProperty(i,"__esModule",{value:!0}),i.fromRdf=c,i.toRdf=l,i.getTermRaw=d,i.getSupportedRdfDatatypes=u,i.getSupportedJavaScriptPrimitives=p;const r=Cp(),n=_f(),s=wn();t(_f(),i),t(s0(),i),t(wn(),i);const o=new r.DataFactory,a=new s.Translator;a.registerHandler(new n.TypeHandlerString,n.TypeHandlerString.TYPES.map(g=>o.namedNode(g)),["string"]),a.registerHandler(new n.TypeHandlerBoolean,[n.TypeHandlerBoolean.TYPE].map(g=>o.namedNode(g)),["boolean"]),a.registerHandler(new n.TypeHandlerNumberDouble,n.TypeHandlerNumberDouble.TYPES.map(g=>o.namedNode(g)),["number"]),a.registerHandler(new n.TypeHandlerNumberInteger,n.TypeHandlerNumberInteger.TYPES.map(g=>o.namedNode(g)),["number"]),a.registerHandler(new n.TypeHandlerDate,n.TypeHandlerDate.TYPES.map(g=>o.namedNode(g)),["object"]);function c(g,v){return a.fromRdf(g,v)}function l(g,v){return v&&"namedNode"in v&&(v={dataFactory:v}),v=v||{},v&&!v.dataFactory&&(v.dataFactory=o),a.toRdf(g,v)}function d(g,v){return g.termType==="Literal"?c(g,v):g.value}function u(){return a.getSupportedRdfDatatypes()}function p(){return a.getSupportedJavaScriptPrimitives()}}(Or)),Or}var $s=o0();function Sf(i){if(i.term.termType!=="BlankNode")return{quantifier:"one",start:"subject",end:"object",predicates:[i.term]};const e=i.out([de.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([de.inversePath]);if(t.term)return{quantifier:"one",start:"object",end:"subject",predicates:[t.term]};const r=i.out([de.oneOrMorePath]);if(r.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[r.term]};const n=i.out([de.zeroOrMorePath]);if(n.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[n.term]};const s=i.out([de.zeroOrOnePath]);if(s.term)return{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[s.term]}}function a0(i){return i.terms.length===0?null:i.ptrs[0].isList()?[...i.list()].map(e=>Sf(e)):[Sf(i)]}class l0{constructor(e){this.shape=e,this._compiled=Ci(()=>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 wi(t.terms)),n=[...t].reduce((o,a)=>{const c=a.term,l=t.node([c]);return o.has(c)||o.set(c,{value:l,valuePaths:[]}),o.get(c).valuePaths.push(a),o},new An).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 c=e.create({shape:this.shape,value:o,valueOrNode:o,valuePaths:a});for(const l of this.compiled)l.generic&&await l.generic(c)}}}function ac(i){const e=new wi,r=new Io({dataset:i.dataset,terms:i.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[$y.subClassOf]});for(const n of r.ptrs)for(const{term:s}of n.nodes())e.add(s);return e}class c0{constructor(e){this.targetClass=new wi([...ac(e.hasOut([zr.type],[de.NodeShape])),...ac(e.out([de.targetClass]))]),this.targetNode=e.out([de.targetNode]).terms,this.targetObjectsOf=e.out([de.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([de.targetSubjectsOf]).terms}resolve(e){const t=e.focusNode.node([null]),r=[...e.focusNode.hasOut([zr.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 wi(n.terms)])}}class d0{constructor(e,{validator:t}){this.ptr=e,this.validator=t,this._deactivated=Ci(()=>{const r=this.ptr.out([de.deactivated]).term;return r&&$s.fromRdf(r)}),this._message=Ci(()=>this.ptr.out([de.message]).terms),this._path=Ci(()=>a0(this.ptr.out([de.path]))),this._severity=Ci(()=>this.ptr.out([de.severity]).term),this._shapeValidator=Ci(()=>new l0(this)),this._sparql=Ci(()=>this.ptr.out([de.sparql])),this._targetResolver=Ci(()=>new c0(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 u0(i){const e=parseInt(i.ptr.out([de.maxCount]).value);return{property:h0(e)}}function h0(i){return e=>{e.test(e.values.terms.length<=i,de.MaxCountConstraintComponent,{args:{maxCount:i},message:[e.factory.literal("More than {$maxCount} values")]})}}function f0(i){const e=parseInt(i.ptr.out([de.minCount]).value);return{property:p0(e)}}function p0(i){return e=>{e.test(e.values.terms.length>=i,de.MinCountConstraintComponent,{args:{minCount:i},message:[e.factory.literal("Less than {$minCount} values")]})}}async function m0(i,e){for(const t of i)if(!await e(t))return!1;return!0}async function g0(i,e){return(await Promise.all(i.map(t=>e(t)))).filter(Boolean)}async function Ko(i,e){return Promise.all(i.map(e))}async function b0(i,e){for(const t of i)if(await e(t))return!0;return!1}function y0(i){const e=[...i.ptr.out([de.and])].flatMap(t=>[...t.list()]).map(t=>i.validator.shape(t));return{generic:v0(e)}}function v0(i){return async e=>{const t=await Ko(i,async n=>(await n.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),r=t.every(n=>n.conforms);e.test(r,de.AndConstraintComponent,{results:t.flatMap(n=>n.results),value:e.valueOrNode})}}function w0(i){const e=i.validator.shape(i.ptr.out([de.not]));return{generic:_0(e)}}function _0(i){return async e=>{const t=(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report,r=!t.conforms;e.test(r,de.NotConstraintComponent,{args:{not:i.ptr.term},message:[e.factory.literal("Value does have shape {$not}")],results:t.results,value:e.valueOrNode})}}function x0(i){const e=[...i.ptr.out([de.or])].flatMap(t=>[...t.list()]).map(t=>i.validator.shape(t));return{generic:E0(e)}}function E0(i){return async e=>{let t=[],r;if(e.options.debug||e.options.details){const n=await Ko(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 b0(i,async n=>(await n.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report.conforms);e.test(r,de.OrConstraintComponent,{results:t,value:e.valueOrNode})}}function S0(i){const e=[...i.ptr.out([de.xone])].flatMap(t=>[...t.list()]).map(t=>i.validator.shape(t));return{generic:k0(e)}}function k0(i){return async e=>{const t=await Ko(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,de.XoneConstraintComponent,{results:t.flatMap(n=>n.results),value:e.valueOrNode})}}function R0(i){if(!$s.fromRdf(i.ptr.out([de.closed]).term))return null;const t=i.ptr.out([de.property]).map(s=>i.validator.shape(s)),r=new wi(t.filter(s=>!s.deactivated).map(s=>s.path[0].predicates[0])),n=new wi([...i.ptr.out([de.ignoredProperties]).list()||[]].map(s=>s.term));return{node:I0(r,n)}}function I0(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(de.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(de.ClosedConstraintComponent)}}function T0(i){const e=i.ptr.out([de.hasValue]).term;return{node:C0(e),property:$0(e)}}function C0(i){return e=>{e.test(i.equals(e.valueOrNode.term),de.HasValueConstraintComponent,{args:{hasValue:i},message:[e.factory.literal("Value must be {$hasValue}")]})}}function $0(i){return e=>{const t=[...e.values].some(r=>i.equals(r.term));e.test(t,de.HasValueConstraintComponent,{args:{hasValue:i},message:[e.factory.literal("Missing expected value {$hasValue}")]})}}function A0(i){const e=new wi([...i.ptr.out([de.in]).list()].map(t=>t.term));return{generic:N0(e)}}function N0(i){return e=>{e.test(i.has(e.valueOrNode.term),de.InConstraintComponent,{args:{in:[...i].map(t=>t.value).join(", ")},message:[e.factory.literal("Value is not in {$in}")],value:e.valueOrNode})}}function Nn(i,e){if(!i||i.termType!=="Literal"||!e||e.termType!=="Literal"||kf(i)!==kf(e))return null;const t=$s.fromRdf(i),r=$s.fromRdf(e);return typeof t!=typeof r?null:typeof t=="string"?t.localeCompare(r):t-r}function kf(i){const e=/^.*(((\+|-)\d{2}:\d{2})|Z)$/;return od.dateTime.equals(i.datatype)&&e.test(i.value)}function D0(i){const e=i.ptr.out([de.disjoint]).term;return{generic:L0(e)}}function L0(i){return e=>{const t=e.focusNode.dataset.match(e.focusNode.term,i,e.valueOrNode.term);e.test(t.size===0,de.DisjointConstraintComponent,{args:{disjoint:i},message:[e.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:e.valueOrNode})}}function O0(i){const e=i.ptr.out([de.equals]).term;return{node:P0(e),property:M0(e)}}function P0(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,de.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 M0(i){return e=>{const t=new wi(e.focusNode.out([i]).terms),r=new wi(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(de.EqualsConstraintComponent,{args:{equals:i},message:[e.factory.literal("Must have same values as {$equals}")],value:e.focusNode.node([a])});o.length===0&&e.debug(de.EqualsConstraintComponent,{args:{equals:i},message:[e.factory.literal("Must have same values as {$equals}")]})}}function F0(i){const e=i.ptr.out([de.lessThan]).term;return{property:j0(e)}}function j0(i){return e=>{const t=e.focusNode.out([i]).terms;for(const r of e.values)for(const n of t){const s=Nn(r.term,n);s===null||s>=0?e.violation(de.LessThanConstraintComponent,{args:{lessThan:i},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r}):e.debug(de.LessThanConstraintComponent,{args:{lessThan:i},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r})}}}function B0(i){const e=i.ptr.out([de.lessThanOrEquals]).term;return{property:q0(e)}}function q0(i){return e=>{const t=e.focusNode.out([i]).terms;for(const r of e.values)for(const n of t){const s=Nn(r.term,n);s===null||s>0?e.violation(de.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:i},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r}):e.debug(de.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:i},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r})}}}function U0(i){const e=i.ptr.out([de.maxExclusive]).term;return{generic:V0(e)}}function V0(i){return e=>{const t=Nn(e.valueOrNode.term,i);e.test(t!==null&&t<0,de.MaxExclusiveConstraintComponent,{args:{maxExclusive:i},message:[e.factory.literal("Value is not less than {$maxExclusive}")],value:e.valueOrNode})}}function z0(i){const e=i.ptr.out([de.maxInclusive]).term;return{generic:H0(e)}}function H0(i){return e=>{const t=Nn(e.valueOrNode.term,i);e.test(t!==null&&t<=0,de.MaxInclusiveConstraintComponent,{args:{maxInclusive:i},message:[e.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:e.valueOrNode})}}function W0(i){const e=i.ptr.out([de.minExclusive]).term;return{generic:G0(e)}}function G0(i){return e=>{const t=Nn(e.valueOrNode.term,i);e.test(t!==null&&t>0,de.MinExclusiveConstraintComponent,{args:{minExclusive:i},message:[e.factory.literal("Value is not greater than {$minExclusive}")],value:e.valueOrNode})}}function K0(i){const e=i.ptr.out([de.minInclusive]).term;return{generic:X0(e)}}function X0(i){return e=>{const t=Nn(e.valueOrNode.term,i);e.test(t!==null&&t>=0,de.MinInclusiveConstraintComponent,{args:{minInclusive:i},message:[e.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:e.valueOrNode})}}function J0(i){const e=[...i.ptr.out([de.node])].map(t=>i.validator.shape(t));return{generic:Q0(e)}}function Q0(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,de.NodeConstraintComponent,{args:{node:t.ptr.term},message:[e.factory.literal("Value does not have shape {$node}")],results:r.report.results,value:e.valueOrNode})}}}function Y0(i){const e=[...i.ptr.out([de.property])].map(t=>i.validator.shape(t));return{generic:Z0(e)}}function Z0(i){return async e=>{const t=e.create({focusNode:e.valueOrNode});for(const r of i)await r.validate(t)}}function ev(i){const e=i.validator.shape(i.ptr.out([de.qualifiedValueShape])),t=i.ptr.out([de.qualifiedValueShapesDisjoint]).term,r=t?$s.fromRdf(t):!1,n=i.ptr.out([de.qualifiedMaxCount]).term,s=n?parseInt(n.value):null,o=i.ptr.out([de.qualifiedMinCount]).term,a=o?parseInt(o.value):null;return{property:tv(e,r,s,a)}}function tv(i,e,t,r){return async n=>{const s=[];let o=[];e&&(o=new Set(n.shape.ptr.in([de.property]).out([de.property]).out([de.qualifiedValueShape]).filter(c=>!c.term.equals(i.ptr.term)).map(c=>n.shape.validator.shape(c))));const a=(await g0(n.values,async c=>{const l=(await i.validate(n.create({child:!0,focusNode:c}))).report;if(s.push(l.results),!l.conforms)return!1;if(o.length===0)return!0;if(n.options.debug||n.options.details){const d=await Ko([...o],async u=>(await u.validate(n.create({child:!0,focusNode:c}))).report);return s.push(d.flatMap(u=>u.results)),!d.every(u=>u.conforms)}else return!await m0([...o],async d=>(await d.validate(n.create({child:!0,focusNode:c}))).report.conforms)})).length;t!==null&&n.test(a<=t,de.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,de.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 iv(i,e){return e?e.slice(0,i.length)===i:!1}function rv(i){const e=[...new Set([...i.ptr.out([de.languageIn]).list()].map(t=>t.value))];return{generic:nv(e)}}function nv(i){return e=>{const t=i.some(r=>iv(r,e.valueOrNode.term.language));e.test(t,de.LanguageInConstraintComponent,{args:{languageIn:i.join(", ")},message:[e.factory.literal("Language does not match any of {$languageIn}")],value:e.valueOrNode})}}function sv(i){const e=parseInt(i.ptr.out([de.maxLength]).value);return{generic:ov(e)}}function ov(i){return e=>{const t=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length<=i;e.test(t,de.MaxLengthConstraintComponent,{args:{maxLength:i},message:[e.factory.literal("Value has more than {$maxLength} characters")],value:e.valueOrNode})}}function av(i){const e=parseInt(i.ptr.out([de.minLength]).value);return{generic:lv(e)}}function lv(i){return e=>{const t=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length>=i;e.test(t,de.MinLengthConstraintComponent,{args:{minLength:i},message:[e.factory.literal("Value has less than {$minLength} characters")],value:e.valueOrNode})}}function cv(i){const e=i.ptr.out([de.pattern]).value,t=i.ptr.out([de.flags]).value,r=new RegExp(e,t);return{generic:dv(e,t,r)}}function dv(i,e,t){return r=>{r.test(t.test(r.valueOrNode.term.value),de.PatternConstraintComponent,{args:{flags:e,pattern:i},message:[r.factory.literal('Value does not match pattern "{$pattern}"')],value:r.valueOrNode})}}function uv(i){const e=i.ptr.out([de.uniqueLang]).term;return e.value==="true"&&od.boolean.equals(e.datatype)?{property:hv()}:null}function hv(){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(de.UniqueLangConstraintComponent,{args:{lang:r},message:[i.factory.literal('Language "{?lang}" used more than once')]});t.length===0&&i.debug(de.UniqueLangConstraintComponent)}}const vo=Si("http://www.w3.org/ns/shacl#"),Vp=Si("https://schemas.link/shacl-next#");class _n{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some(e=>e.severity.equals(vo.Info)||e.severity.equals(vo.Violation)||e.severity.equals(vo.Warning))}}function fv(i,e){return Object.entries(e).reduce((t,[r,n])=>(n&&n.termType&&(n=ci(n)),t.replace(`{$${r}}`,n).replace(`{?${r}}`,n)),i)}class To{constructor({args:e={},factory:t,message:r=[],severity:n=vo.Violation}={}){this.severity=n,this.message=r.map(s=>t.literal(fv(s.value,e),s.language||null))}}class ld{constructor({factory:e=sd}={}){this.factory=e}clone({factory:e}={}){return new ld({factory:e||this.factory})}validate(){return new _n}validateSimple(){return!0}}class Dn extends ld{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 pv{constructor({factory:e=sd,validations:t}={}){if(this.factory=e,this.validations=new An,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 _n}validateSimple(e){const t=this.validations.get(e.datatype);return t?t.validateSimple(e):!0}}class lt 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 lt(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const t=this.patterns.map(r=>{let n;r.test(e.value)&&(n=Vp.Debug);const s={pattern:this.factory.literal(r.toString()),this:e};return new To({args:s,factory:this.factory,message:this.message,severity:n})});return new _n({results:t})}validateSimple(e){return this.patterns.every(t=>t.test(e.value))}}const mv=/^([-+]?[0-9]+)$/;class Qt extends lt{constructor(e=null,t=null,r,{factory:n}={}){super(mv,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}={}){return new Qt(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const t=super.validate(e).results;if(!Vp.Debug.equals(t[0].severity))return new _n({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 To({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 To({factory:this.factory,message:s}))}return new _n({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 cd extends Dn{constructor(e,t,{factory:r}={}){super({datatypes:t,factory:r}),this.values=new Set(e)}clone({factory:e}={}){return new cd(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 To({factory:this.factory,message:n}))}return new _n({results:t})}validateSimple(e){return this.values.has(e.value)}}const We={xsd:Si("http://www.w3.org/2001/XMLSchema#")},gv=new Dn({datatypes:We.xsd.anySimpleType}),bv=new Dn({datatypes:We.xsd.anyAtomicType}),Xo=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,yv=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,zp=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,dd=/^(-?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)))))$/,Hp=/^(-?([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))?)$/,vv=/^((([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))?)$/,wv=/^(-?([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))?)$/,_v=/^(-?([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))?)$/,xv=/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Ev=/^(--(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))?)$/,Sv=/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,kv=/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Rv=/^(([0-9a-fA-F]{2})*)$/,Iv=/^(((([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] ?= ?=))?)$/,Tv=new lt(Xo,We.xsd.string),Cv=new cd(["1","true","0","false"],We.xsd.boolean),$v=new lt(yv,We.xsd.decimal),Av=new lt(zp,We.xsd.float),Nv=new lt(zp,We.xsd.double),Dv=new lt(dd,We.xsd.duration),Lv=new lt(Hp,We.xsd.dateTime),Ov=new lt(vv,We.xsd.time),Pv=new lt(wv,We.xsd.date),Mv=new lt(_v,We.xsd.gYearMonth),Fv=new lt(xv,We.xsd.gYear),jv=new lt(Ev,We.xsd.gMonthDay),Bv=new lt(Sv,We.xsd.gDay),qv=new lt(kv,We.xsd.gMonth),Uv=new lt(Rv,We.xsd.hexBinary),Vv=new lt(Iv,We.xsd.base64Binary),zv=new lt(Xo,We.xsd.anyURI),Wp=/^([^\u000d\u000a\u0009]*)$/,Hv=/^([^ ]+( [^ ]+)*)*$/,Wv=/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,Gv=/^([^DT]*)$/,Kv=/^([^YM]*[DT].*)$/,Xv=/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/,Jv=new lt([Xo,Wp],We.xsd.normalizedString),Qv=new lt([Xo,Wp,Hv],We.xsd.token),Yv=new lt(Wv,We.xsd.language),Zv=new Qt(null,null,We.xsd.integer),ew=new Qt(null,"0",We.xsd.nonPositiveInteger),tw=new Qt(null,"-1",We.xsd.negativeInteger),iw=new Qt("-9223372036854775808","9223372036854775807",We.xsd.long),rw=new Qt("-2147483648","2147483647",We.xsd.int),nw=new Qt("-32768","32767",We.xsd.short),sw=new Qt("-128","127",We.xsd.byte),ow=new Qt("0",null,We.xsd.nonNegativeInteger),aw=new Qt("0","18446744073709551615",We.xsd.unsignedLong),lw=new Qt("0","4294967295",We.xsd.unsignedInt),cw=new Qt("0","65535",We.xsd.unsignedShort),dw=new Qt("0","255",We.xsd.unsignedByte),uw=new Qt("1",null,We.xsd.positiveInteger),hw=new lt([dd,Gv],We.xsd.yearMonthDuration),fw=new lt([dd,Kv],We.xsd.dayTimeDuration),pw=new lt([Hp,Xv],We.xsd.dateTimeStamp),mw=Object.freeze(Object.defineProperty({__proto__:null,anyAtomicType:bv,anySimpleType:gv,anyURI:zv,base64Binary:Vv,boolean:Cv,byte:sw,date:Pv,dateTime:Lv,dateTimeStamp:pw,dayTimeDuration:fw,decimal:$v,double:Nv,duration:Dv,float:Av,gDay:Bv,gMonth:qv,gMonthDay:jv,gYear:Fv,gYearMonth:Mv,hexBinary:Uv,int:rw,integer:Zv,language:Yv,long:iw,negativeInteger:tw,nonNegativeInteger:ow,nonPositiveInteger:ew,normalizedString:Jv,positiveInteger:uw,short:nw,string:Tv,time:Ov,token:Qv,unsignedByte:dw,unsignedInt:lw,unsignedLong:aw,unsignedShort:cw,yearMonthDuration:hw},Symbol.toStringTag,{value:"Module"}));class gw extends pv{constructor({factory:e}={}){super({factory:e,validations:{...mw}})}}const bw=new An([[de.BlankNode,new Set(["BlankNode"])],[de.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[de.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[de.IRI,new Set(["NamedNode"])],[de.IRIOrLiteral,new Set(["NamedNode","Literal"])],[de.Literal,new Set(["Literal"])]]);function yw(i){const e=i.ptr.out([de.class]).map(t=>ac(t));return{generic:vw(e)}}function vw(i){return e=>{const t=new wi(e.valueOrNode.out([zr.type]).terms);for(const r of i){const n=[...t].some(s=>r.has(s));e.test(n,de.ClassConstraintComponent,{value:e.valueOrNode})}}}function ww(i){const e=i.ptr.out([de.datatype]).term,t=new gw;return{generic:_w(e,t)}}function _w(i,e){return t=>{const r=i.equals(t.valueOrNode.term.datatype)&&e.validateSimple(t.valueOrNode.term);t.test(r,de.DatatypeConstraintComponent,{args:{datatype:i},message:[t.factory.literal("Value does not have datatype {$datatype}")],value:t.valueOrNode})}}function xw(i){const e=i.ptr.out([de.nodeKind]).term,t=bw.get(e);return{generic:Ew(e,t)}}function Ew(i,e){return t=>{t.test(e.has(t.valueOrNode.term.termType),de.NodeKindConstraintComponent,{args:{nodeKind:i},message:[t.factory.literal("Value does not have node kind {$nodeKind}")],value:t.valueOrNode})}}const Sw=new An([[de.maxCount,u0],[de.minCount,f0],[de.and,y0],[de.not,w0],[de.or,x0],[de.xone,S0],[de.closed,R0],[de.hasValue,T0],[de.in,A0],[de.disjoint,D0],[de.equals,O0],[de.lessThan,F0],[de.lessThanOrEquals,B0],[de.maxExclusive,U0],[de.maxInclusive,z0],[de.minExclusive,W0],[de.minInclusive,K0],[de.node,J0],[de.property,Y0],[de.qualifiedValueShape,ev],[de.languageIn,rv],[de.maxLength,sv],[de.minLength,av],[de.pattern,cv],[de.uniqueLang,uv],[de.class,yw],[de.datatype,ww],[de.nodeKind,xw]]);class kw{constructor(e,{factory:t,...r}){if(this.factory=t,this.options=r,this.registry=new Zy(Sw),this.shapesPtr=new Io({dataset:e,factory:t}),this.shapes=new An,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([de.targetClass]),...this.shapesPtr.hasOut([de.targetNode]),...this.shapesPtr.hasOut([de.targetObjectsOf]),...this.shapesPtr.hasOut([de.targetSubjectsOf]),...this.shapesPtr.hasOut([zr.type],[de.NodeShape]),...this.shapesPtr.hasOut([zr.type],[de.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 d0(e,{validator:this}),this.shapes.set(e.term,t)),t}async validate(e,t){const r=new Io({...e,factory:this.factory}),n=new ad({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 c of a)await s.validate(o.create({focusNode:c}))}return n.report}}let Rw=class extends HTMLElement{constructor(e){super(),this.shape=null,this.attachShadow({mode:"open"}),this.form=document.createElement("form"),this.config=new qh(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 qh.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 Eg())r.stylesheet&&t.push(r.stylesheet);if(this.shadowRoot.adoptedStyleSheets=t,this.shape=new yr(e,this.config,this.config.attributes.valuesSubject?He.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=>{if(s?.conforms)this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0}));else{let o=this.form.querySelector(":scope .invalid > .editor");o?o.focus():this.form.querySelector(":scope .invalid")?.scrollIntoView()}})}),this.form.appendChild(r)}this.config.attributes.valuesSubject&&this.removeFromDataGraph(He.namedNode(this.config.attributes.valuesSubject)),await this.validate(!0)}}else if(this.config.store.countQuads(null,null,null,xo)>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 vg(r,e,this.config.prefixes)}toRDF(e=new jt){return this.shape?.toRDF(e),e}registerPlugin(e){xg(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setSharedShapesGraph(e){py(e),this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}async validate(e=!1){for(const t of this.form.querySelectorAll(":scope .validation-error"))t.remove();for(const t of this.form.querySelectorAll(":scope .property-instance"))t.classList.remove("invalid"),t.querySelector(":scope > .editor")?.value?t.classList.add("valid"):t.classList.remove("valid");this.config.store.deleteGraph(this.config.valuesGraphId||""),this.shape?.toRDF(this.config.store),this.shape&&this.config.store.add(new Fo(this.shape.shaclSubject,He.namedNode(Oe+"targetNode"),this.shape.nodeId,this.config.valuesGraphId));try{const t=this.config.store,r=await new kw(t,{details:!0,factory:He}).validate({dataset:t});for(const n of r.results)if(n.focusNode?.ptrs?.length)for(const s of n.focusNode.ptrs){const o=s._term;if(n.path?.length){const a=n.path[0].predicates[0];let c=this.form.querySelectorAll(`
345
370
  :scope shacl-node[data-node-id='${o.id}'] > shacl-property > .property-instance[data-path='${a.id}'] > .editor,
346
371
  :scope shacl-node[data-node-id='${o.id}'] > shacl-property > .shacl-group > .property-instance[data-path='${a.id}'] > .editor,
347
372
  :scope shacl-node[data-node-id='${o.id}'] > .shacl-group > shacl-property > .property-instance[data-path='${a.id}'] > .editor,
348
- :scope shacl-node[data-node-id='${o.id}'] > .shacl-group > shacl-property > .shacl-group > .property-instance[data-path='${a.id}'] > .editor`);l.length===0&&(l=this.form.querySelectorAll(`
373
+ :scope shacl-node[data-node-id='${o.id}'] > .shacl-group > shacl-property > .shacl-group > .property-instance[data-path='${a.id}'] > .editor`);c.length===0&&(c=this.form.querySelectorAll(`
349
374
  :scope [data-node-id='${o.id}'] > shacl-property > .property-instance[data-path='${a.id}'],
350
- :scope [data-node-id='${o.id}'] > shacl-property > .shacl-group > .property-instance[data-path='${a.id}']`));for(const c of l)if(c.classList.contains("editor")){if(!e||c.value){let d=c.parentElement;d.classList.add("invalid"),d.classList.remove("valid"),d.appendChild(this.createValidationErrorDisplay(n));do d instanceof Yt&&(d.open=!0),d=d.parentElement;while(d)}}else e||(c.classList.add("invalid"),c.classList.remove("valid"),c.appendChild(this.createValidationErrorDisplay(n,"node")))}else e||this.form.querySelector(`:scope [data-node-id='${o.id}']`)?.prepend(this.createValidationErrorDisplay(n,"node"))}return r}catch(t){return console.error(t),!1}}createValidationErrorDisplay(e,t){const r=document.createElement("span");if(r.classList.add("validation-error"),t&&r.classList.add(t),e)if(e.message?.length>0)for(const n of e.message)r.title+=n.value+`
351
- `;else r.title=e.sourceConstraintComponent?.value;return r}findRootShaclShapeSubject(){let e=null;if(this.config.attributes.shapeSubject){if(e=Fe.namedNode(this.config.attributes.shapeSubject),this.config.store.getQuads(e,Tt,Ts,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,Ii)>0){const t=Fe.namedNode(this.config.attributes.valuesSubject),r=[...this.config.store.getQuads(t,Tt,null,Ii),...this.config.store.getQuads(t,El,null,Ii)];if(r.length===0){console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${Tt.id} nor ${El.id} statement`);return}for(const n of r)if(this.config.store.getQuads(n.object,Tt,Ts,null).length>0){e=n.object;break}if(!e){const n=this.config.store.getQuads(null,ts,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,Tt,Ts,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,Tt,Ts,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,Ii))this.config.store.delete(t),(t.object.termType==="NamedNode"||t.object.termType==="BlankNode")&&this.removeFromDataGraph(t.object)}};function Hh(i){return i!==null&&typeof i=="object"&&"constructor"in i&&i.constructor===Object}function Pc(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]:Hh(e[r])&&Hh(i[r])&&Object.keys(e[r]).length>0&&Pc(i[r],e[r])})}const dp={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 Pc(i,dp),i}const P0={document:dp,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 Pc(i,P0),i}const j0=i=>i?.nodeName.toLowerCase()??"",ms=(i,e)=>i?.nodeName.toLowerCase()===e.toLowerCase(),dt=i=>typeof i=="function",ut=i=>typeof i=="string",vo=i=>typeof i=="number",B0=i=>typeof i=="boolean",at=i=>typeof i>"u",jc=i=>i===null,Bc=i=>typeof Window<"u"&&i instanceof Window,Fc=i=>typeof Document<"u"&&i instanceof Document,qi=i=>typeof Element<"u"&&i instanceof Element,F0=i=>typeof Node<"u"&&i instanceof Node,qr=i=>!dt(i)&&!Bc(i)&&vo(i.length),ji=i=>typeof i=="object"&&i!==null,Xs=i=>Fc(i)?i.documentElement:i,wo=i=>i.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),up=i=>i&&i.replace(/^./,i[0].toLowerCase()).replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),hp=()=>!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 Rt{constructor(e){return this.length=0,e?(rt(e,(t,r)=>{this[r]=t}),this.length=e.length,this):this}}const Ys=(i=zt())=>/complete|interactive/.test(i.readyState),_o=i=>zt().createElement(i),qc=(i,e)=>i.appendChild(e),Uc=i=>i.parentNode?i.parentNode.removeChild(i):i,fp=(i,e)=>{const t=_o(e);return t.innerHTML=i,[].slice.call(t.childNodes)},q0=()=>{const i=function(e){if(!e)return new Rt;if(e instanceof Rt)return e;if(dt(e)){const t=zt();return Ys(t)?e.call(t,i):t.addEventListener("DOMContentLoaded",()=>e.call(t,i),{once:!0}),new Rt([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 Rt(fp(t,n))}const r=zt();return new Rt(r.querySelectorAll(e))}return qr(e)&&!F0(e)?new Rt(e):new Rt([e])};return i.fn=Rt.prototype,i},se=q0(),Vc=(i,e)=>(rt(e,t=>{i.push(t)}),i),gs=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 Rt(gs(Vc(this.get(),se(i).get())))};const pp=(i,e,t)=>{const r=i.getAttribute(e);return jc(r)?t:r},mp=(i,e)=>{i.removeAttribute(e)},gp=(i,e,t)=>{jc(t)?mp(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)=>{gp(r,"class","")}):this.each((t,r)=>{if(!qi(r))return;const n=(dt(e)?e.call(r,t,pp(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 U0=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;U0(o)?a=se(fp(o,"div")):r&&qi(o)?a=se(o.cloneNode(!0)):a=se(o),a[e?"insertAfter":"insertBefore"](n)})})}});function yp(i,e){return qr(i)?rt(i,(t,r)=>e.call(t,r,t)):Nt(i,e)}function Kn(i,e){const t=ar();let r;const n=[];return yp(i,(s,o)=>{r=e.call(t,o,s),r!=null&&n.push(r)}),[].concat(...n)}se.fn.map=function(i){return new Rt(Kn(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)=>{Fc(n)||Bc(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))&&Uc(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]:_o("div");o||qc(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||Uc(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=_o("div");return qc(a,d),r.push(d),d}),s=this[e?"insertBefore":"insertAfter"](n);return se(r).remove(),s}});const xo=(i,e)=>ar().getComputedStyle(i).getPropertyValue(up(e)),bp=i=>xo(i,"box-sizing")==="border-box",Dl=(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(xo(i,a)||"0")},0)},Eo=(i,e)=>{if(e==="width"||e==="height"){const t=i.getBoundingClientRect()[e];return bp(i)?`${t}px`:`${t-Dl(i,e,"border")-Dl(i,e,"padding")}px`}return xo(i,e)},V0=["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 gp(n,s,o);if(e===1){n[s]=o;return}s=up(s);const a=()=>s.startsWith("--")||V0.includes(s)?"":"px";n.style.setProperty(s,vo(o)?`${o}${a()}`:o)},r=(n,s)=>e===0?pp(n,s):e===1?n[s]:Eo(n,s);se.fn[i]=function(n,s){if(ji(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 Rt(gs(e))};se.fn.slice=function(...i){return new Rt([].slice.apply(this,i))};se.fn.eq=function(i){const e=i===-1?this.slice(i):this.slice(i,+i+1);return new Rt(e)};const zc=(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 Rt(gs(s))};rt(["","s","sUntil"],(i,e)=>{se.fn[`parent${i}`]=function(t,r){const n=e?se(this.get().reverse()):this;return zc(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 Rt(e)};const So=new WeakMap,ys=i=>So.get(i)??{},vp=(i,e)=>{const t=ys(i),r=wo(e);return r in t?t[r]:void 0},Hc=(i,e)=>{const t=ys(i);Nt(e,(r,n)=>{t[wo(r)]=n}),So.set(i,t)},wp=(i,e,t)=>{Hc(i,{[e]:t})},z0=i=>{So.delete(i)},H0=(i,e)=>{const t=ys(i);rt(e,r=>{const n=wo(r);delete t[n]}),So.set(i,t)},W0=/^(?:{[\w\W]*\}|\[[\w\W]*\])$/,G0=i=>i==="true"?!0:i==="false"?!1:i==="null"?null:i===+i+""?+i:W0.test(i)?JSON.parse(i):i,Wh=(i,e,t)=>{if(at(t)&&i.nodeType===1&&(t=i.dataset[e],ut(t)))try{t=G0(t)}catch{}return t};se.fn.data=function(i,e){if(at(i)){if(!this.length)return;const t=this[0],r=ys(t);return t.nodeType!==1||Nt(t.dataset,n=>{r[n]=Wh(t,n,r[n])}),r}if(ji(i))return this.each(function(){Hc(this,i)});if(arguments.length===2&&at(e))return this;if(!at(e))return this.each(function(){wp(this,i,e)});if(this.length)return Wh(this[0],wo(i),vp(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)=>{Vc(e,se(r.querySelectorAll(i)).get())}),new Rt(e)};se.fn.first=function(){return this.eq(0)};const Wc=(i,e)=>i!==e&&Xs(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(Wc(this,e[r]))return this})};se.fn.hasClass=function(i){return this[0].classList.contains(i)};const _p=(i,e,t,r,n,s)=>{const o=a=>Dl(i,e.toLowerCase(),a)*s;return r===2&&n&&(t+=o("margin")),bp(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},xp=(i,e,t,r)=>{const n=zt(),s=`client${e}`,o=`scroll${e}`,a=`offset${e}`,l=`inner${e}`;if(Bc(i))return t===2?i[l]:Xs(n)[s];if(Fc(i)){const d=Xs(i);return Math.max(i.body[o],d[o],i.body[a],d[a],d[s])}const c=parseFloat(xo(i,e.toLowerCase())||"0");return _p(i,e,c,t,r,1)},K0=(i,e,t,r,n,s)=>{let o=dt(s)?s.call(i,e,xp(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=_p(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||!B0(r)),o=r===!0||n===!0;return s?this.each((a,l)=>K0(l,a,i,t,o,r)):this.length?xp(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 Kn(o,c=>Xs(c)[r]).join("");if(!o.length)return;const a=o[0],l=se(a);return e===0&&l.is("select[multiple]")?Kn(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]")?Kn(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 zc(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 J0=ar().CustomEvent;class Q0 extends J0{constructor(e,t){super(e,t),this.data=t.data,this.namespace=t.namespace}}const hl=new WeakMap;let X0=1;const Ol=i=>(hl.has(i)||hl.set(i,++X0),hl.get(i)),Gh=new Map,Zs=i=>{const e=Ol(i);return Gh.get(e)||Gh.set(e,[]).get(e)},Gc=i=>{const e=i.split(".");return{type:e[0],namespace:e.slice(1).sort().join(" ")}},Ep=i=>new RegExp("(?:^| )"+i.replace(" "," .* ?")+"(?: |$)"),Y0=(i,e,t,r)=>{const n=Gc(e);return Zs(i).filter(s=>s&&(!n.type||s.type===n.type)&&(!n.namespace||Ep(n.namespace).test(s.namespace))&&(!t||Ol(s.func)===Ol(t))&&(!r||s.selector===r))},Z0=(i,e,t,r,n)=>{let s=!1;ji(r)&&r.useCapture&&(s=!0),e.split(" ").forEach(o=>{if(!o)return;const a=Gc(o),l=(f,g)=>{t.apply(g,f.detail===null?[f]:[f].concat(f.detail))===!1&&(f.preventDefault(),f.stopPropagation())},c=f=>{f.namespace&&!Ep(f.namespace).test(a.namespace)||(f.data=r,n?se(i).find(n).get().reverse().forEach(g=>{(g===f.target||Wc(g,f.target))&&l(f,g)}):l(f,i))},d={type:a.type,namespace:a.namespace,func:t,selector:n,id:Zs(i).length,proxy:c};Zs(i).push(d),i.addEventListener(d.type,c,s)})},ew=(i,e,t,r)=>{const n=Zs(i),s=o=>{delete n[o.id],i.removeEventListener(o.type,o.proxy,!1)};e?e.split(" ").forEach(o=>{o&&Y0(i,o,t,r).forEach(a=>{s(a)})}):n.forEach(o=>{s(o)})};se.fn.off=function(i,e,t){return ji(i)?(Nt(i,(r,n)=>{this.off(r,e,n)}),this):((e===!1||dt(e))&&(t=e,e=void 0),t===!1&&(t=hp),this.each(function(){ew(this,i,t,e)}))};function ko(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 As=(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+=As(r,"border-top-width"),t.left+=As(r,"border-left-width")}return{top:e.top-t.top-As(i,"margin-top"),left:e.left-t.left-As(i,"margin-left")}};const Sp=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}},tw=(i,e,t)=>{const r=se(i),n=r.css("position");n==="static"&&r.css("position","relative");const s=Sp(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,ko({},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){tw(this,i,e)}):this.length?Sp(this[0]):void 0};se.fn.on=function(i,e,t,r,n){if(ji(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=hp;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(){Z0(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 zc(n,e,"previousElementSibling",t,r)}});se.fn.removeAttr=function(i){const e=i.split(" ").filter(t=>t);return this.each(function(){rt(e,t=>{mp(this,t)})})};const kp=(i,e)=>{if(at(e))return z0(i);const t=ut(e)?e.split(" ").filter(r=>r):e;H0(i,t)};se.fn.removeData=function(i){return this.each((e,t)=>{kp(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 Kc=i=>{if(!ji(i)&&!Array.isArray(i))return"";const e=[],t=(r,n)=>{let s;ji(n)?Nt(n,(o,a)=>{s=Array.isArray(n)&&!ji(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("&")},jr=new WeakMap,Ip=i=>{const e=[...i.elements],t=jr.get(i)||[],r=(n,s)=>n.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1;return[...e,...t].sort(r)},Rp=i=>{const e=[];return i.each((t,r)=>{const n=r instanceof HTMLFormElement?Ip(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 Rp(this).map(i=>Array.isArray(i.value)?i.value.map(e=>({name:i.name,value:e})):i).flat()};se.fn.serialize=function(){return Kc(this.serializeArray())};se.fn.serializeObject=function(){const i={};return Rp(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 fl={},iw=i=>{const e=zt();let t,r;return fl[i]||(t=_o(i),qc(e.body,t),r=Eo(t,"display"),Uc(t),r==="none"&&(r="block"),fl[i]=r),fl[i]};se.fn.show=function(){return this.each((i,e)=>{e.style.display==="none"&&(e.style.display=""),Eo(e,"display")==="none"&&(e.style.display=iw(e.nodeName))})};se.fn.siblings=function(i){return this.prevAll(i).add(this.nextAll(i))};se.fn.toggle=function(){return this.each((i,e)=>{Eo(e,"display")==="none"?se(e).show():se(e).hide()})};se.fn.trigger=function(i,e=null,t){const{type:r,namespace:n}=Gc(i),s=new Q0(r,{detail:e,data:null,namespace:n,bubbles:!0,cancelable:!1,composed:!0,...t});return this.each((o,a)=>{a.dispatchEvent(s)})};const rw="ajaxStart",Kh="ajaxSuccess",Ns="ajaxError",pl="ajaxComplete",Jn={},nw=i=>["GET","HEAD"].includes(i),Jh=(i,e)=>`${i}&${e}`.replace(/[&?]{1,2}/,"?"),sw=i=>{const e=ar();return/^([\w-]+:)?\/\/([^/]+)/.test(i)&&RegExp.$2!==e.location.host},ow=i=>i>=200&&i<300||[0,304].includes(i),aw=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(Jn,(t,r)=>{!["beforeSend","success","error","complete","statusCode"].includes(t)&&!at(r)&&(e[t]=r)}),ko({},e,i)},Tp=i=>{const e=zt(),t=ar();let r=!1;const n={},s={},o=aw(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=nw(a);l&&(T||d)&&!ut(l)&&!(l instanceof ArrayBuffer)&&!(l instanceof Blob)&&!(l instanceof Document)&&!(l instanceof FormData)&&(l=Kc(l)),l&&T&&(c=Jh(c,l),l=null);const N=(j,R,...P)=>{m&&se(e).trigger(j,R==="success"?s:n);let q,I;R in Jn&&(q=Jn[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=X=>P(new Error(X));T&&!g&&(c=Jh(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(_,(X,A)=>{at(A)||I.setRequestHeader(X,A+"")}),sw(c)||I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Nt(E,(X,A)=>{I[X]=A}),n.xhr=s.xhr=I,n.options=s.options=o;let L;if(I.onload=()=>{L&&clearTimeout(L);const X=ow(I.status);let A;if(X)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(Ns,"error",I,j),q(j)}j!=="parsererror"&&(N(Kh,"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(Kh,"success",A,j,I),R(A);else j="error",N(Ns,"error",I,j),q(j);rt([Jn.statusCode??{},S],Y=>{Y[I.status]&&(X?Y[I.status](A,j,I):Y[I.status](I,j))}),N(pl,"complete",I,j)},I.onerror=()=>{L&&clearTimeout(L),N(Ns,"error",I,I.statusText),N(pl,"complete",I,"error"),q(I.statusText)},I.onabort=()=>{let X="abort";L&&(X="timeout",clearTimeout(L)),N(Ns,"error",I,X),N(pl,"complete",I,X),q(X)},N(rw,"beforeSend",I,o),r)return q("cancel");u>0&&(L=t.setTimeout(()=>I.abort(),u)),I.send(l)})})()};se.ajax=Tp;const lw=i=>ko(Jn,i);se.ajaxSetup=lw;se.contains=Wc;function cw(i,e,t){return ji(e)?(Hc(i,e),e):at(t)?at(e)?ys(i):vp(i,e):(wp(i,e,t),t)}se.data=cw;se.each=yp;se.extend=function(i,...e){return e.length?ko(i,...e):(Nt(i,(t,r)=>{this[t]=r}),this)};se.map=Kn;se.merge=Vc;se.param=Kc;se.removeData=kp;se.unique=gs;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}/**
375
+ :scope [data-node-id='${o.id}'] > shacl-property > .shacl-group > .property-instance[data-path='${a.id}']`));for(const l of c)if(l.classList.contains("editor")){if(!e||l.value){let d=l.parentElement;d.classList.add("invalid"),d.classList.remove("valid"),d.appendChild(this.createValidationErrorDisplay(n));do d instanceof di&&(d.open=!0),d=d.parentElement;while(d)}}else e||(l.classList.add("invalid"),l.classList.remove("valid"),l.appendChild(this.createValidationErrorDisplay(n,"node")))}else e||this.form.querySelector(`:scope [data-node-id='${o.id}']`)?.prepend(this.createValidationErrorDisplay(n,"node"))}return r}catch(t){return console.error(t),!1}}createValidationErrorDisplay(e,t){const r=document.createElement("span");if(r.classList.add("validation-error"),t&&r.classList.add(t),e)if(e.message?.length>0)for(const n of e.message)r.title+=n.value+`
376
+ `;else r.title=e.sourceConstraintComponent?.value;return r}findRootShaclShapeSubject(){let e=null;if(this.config.attributes.shapeSubject){if(e=He.namedNode(this.config.attributes.shapeSubject),this.config.store.getQuads(e,qt,no,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,Fi)>0){const t=He.namedNode(this.config.attributes.valuesSubject),r=[...this.config.store.getQuads(t,qt,null,Fi),...this.config.store.getQuads(t,Yl,null,Fi)];if(r.length===0){console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${qt.id} nor ${Yl.id} statement`);return}for(const n of r)if(this.config.store.getQuads(n.object,qt,no,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,qt,no,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,qt,no,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,Fi))this.config.store.delete(t),(t.object.termType==="NamedNode"||t.object.termType==="BlankNode")&&this.removeFromDataGraph(t.object)}};function Rf(i){return i!==null&&typeof i=="object"&&"constructor"in i&&i.constructor===Object}function ud(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]:Rf(e[r])&&Rf(i[r])&&Object.keys(e[r]).length>0&&ud(i[r],e[r])})}const Gp={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 ii(){const i=typeof document<"u"?document:{};return ud(i,Gp),i}const Iw={document:Gp,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 Er(){const i=typeof window<"u"?window:{};return ud(i,Iw),i}const Tw=i=>i?.nodeName.toLowerCase()??"",Us=(i,e)=>i?.nodeName.toLowerCase()===e.toLowerCase(),vt=i=>typeof i=="function",wt=i=>typeof i=="string",Jo=i=>typeof i=="number",Cw=i=>typeof i=="boolean",gt=i=>typeof i>"u",hd=i=>i===null,fd=i=>typeof Window<"u"&&i instanceof Window,pd=i=>typeof Document<"u"&&i instanceof Document,tr=i=>typeof Element<"u"&&i instanceof Element,$w=i=>typeof Node<"u"&&i instanceof Node,un=i=>!vt(i)&&!fd(i)&&Jo(i.length),Yi=i=>typeof i=="object"&&i!==null,Co=i=>pd(i)?i.documentElement:i,Qo=i=>i.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),Kp=i=>i&&i.replace(/^./,i[0].toLowerCase()).replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),Xp=()=>!1,dt=(i,e)=>{for(let t=0;t<i.length;t+=1)if(e.call(i[t],i[t],t)===!1)return i;return i},zt=(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 Bt{constructor(e){return this.length=0,e?(dt(e,(t,r)=>{this[r]=t}),this.length=e.length,this):this}}const $o=(i=ii())=>/complete|interactive/.test(i.readyState),Yo=i=>ii().createElement(i),md=(i,e)=>i.appendChild(e),gd=i=>i.parentNode?i.parentNode.removeChild(i):i,Jp=(i,e)=>{const t=Yo(e);return t.innerHTML=i,[].slice.call(t.childNodes)},Aw=()=>{const i=function(e){if(!e)return new Bt;if(e instanceof Bt)return e;if(vt(e)){const t=ii();return $o(t)?e.call(t,i):t.addEventListener("DOMContentLoaded",()=>e.call(t,i),{once:!0}),new Bt([t])}if(wt(e)){const t=e.trim();if(t.startsWith("<")&&t.endsWith(">")){let n="div";return zt({li:"ul",tr:"tbody",td:"tr",th:"tr",tbody:"table",option:"select"},(o,a)=>{if(t.startsWith(`<${o}`))return n=a,!1}),new Bt(Jp(t,n))}const r=ii();return new Bt(r.querySelectorAll(e))}return un(e)&&!$w(e)?new Bt(e):new Bt([e])};return i.fn=Bt.prototype,i},oe=Aw(),bd=(i,e)=>(dt(e,t=>{i.push(t)}),i),Vs=i=>[...new Set(i)];oe.fn.get=function(i){return i===void 0?[].slice.call(this):this[i>=0?i:i+this.length]};oe.fn.add=function(i){return new Bt(Vs(bd(this.get(),oe(i).get())))};const Qp=(i,e,t)=>{const r=i.getAttribute(e);return hd(r)?t:r},Yp=(i,e)=>{i.removeAttribute(e)},Zp=(i,e,t)=>{hd(t)?Yp(i,e):i.setAttribute(e,t)};oe.fn.each=function(i){return dt(this,(e,t)=>i.call(e,t,e))};dt(["add","remove","toggle"],i=>{oe.fn[`${i}Class`]=function(e){return i==="remove"&&!arguments.length?this.each((t,r)=>{Zp(r,"class","")}):this.each((t,r)=>{if(!tr(r))return;const n=(vt(e)?e.call(r,t,Qp(r,"class","")):e).split(" ").filter(s=>s);dt(n,s=>{r.classList[i](s)})})}});dt(["insertBefore","insertAfter"],(i,e)=>{oe.fn[i]=function(t){const r=e?oe(this.get().reverse()):this,n=oe(t),s=[];return n.each((o,a)=>{a.parentNode&&r.each((c,l)=>{const d=o?l.cloneNode(!0):l,u=e?a.nextSibling:a;s.push(d),a.parentNode.insertBefore(d,u)})}),oe(e?s.reverse():s)}});const Nw=i=>wt(i)&&!(i.startsWith("<")&&i.endsWith(">"));dt(["before","after"],(i,e)=>{oe.fn[i]=function(...t){return e===1&&(t=t.reverse()),this.each((r,n)=>{const s=vt(t[0])?[t[0].call(n,r,n.innerHTML)]:t;dt(s,o=>{let a;Nw(o)?a=oe(Jp(o,"div")):r&&tr(o)?a=oe(o.cloneNode(!0)):a=oe(o),a[e?"insertAfter":"insertBefore"](n)})})}});function em(i,e){return un(i)?dt(i,(t,r)=>e.call(t,r,t)):zt(i,e)}function ws(i,e){const t=Er();let r;const n=[];return em(i,(s,o)=>{r=e.call(t,o,s),r!=null&&n.push(r)}),[].concat(...n)}oe.fn.map=function(i){return new Bt(ws(this,(e,t)=>i.call(e,t,e)))};oe.fn.clone=function(){return this.map(function(){return this.cloneNode(!0)})};oe.fn.is=function(i){let e=!1;if(vt(i))return this.each((r,n)=>{i.call(n,r,n)&&(e=!0)}),e;if(wt(i))return this.each((r,n)=>{pd(n)||fd(n)||n.matches.call(n,i)&&(e=!0)}),e;const t=oe(i);return this.each((r,n)=>{t.each((s,o)=>{n===o&&(e=!0)})}),e};oe.fn.remove=function(i){return this.each((e,t)=>{(!i||oe(t).is(i))&&gd(t)})};dt(["prepend","append"],(i,e)=>{oe.fn[i]=function(...t){return this.each((r,n)=>{const s=n.childNodes,o=s.length,a=o?s[e?o-1:0]:Yo("div");o||md(n,a);let c=vt(t[0])?[t[0].call(n,r,n.innerHTML)]:t;r&&(c=c.map(l=>wt(l)?l:oe(l).clone())),oe(a)[e?"after":"before"](...c),o||gd(a)})}});dt(["appendTo","prependTo"],(i,e)=>{oe.fn[i]=function(t){const r=[],n=oe(t).map((o,a)=>{const c=a.childNodes,l=c.length;if(l)return c[e?0:l-1];const d=Yo("div");return md(a,d),r.push(d),d}),s=this[e?"insertBefore":"insertAfter"](n);return oe(r).remove(),s}});const Zo=(i,e)=>Er().getComputedStyle(i).getPropertyValue(Kp(e)),tm=i=>Zo(i,"box-sizing")==="border-box",lc=(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(Zo(i,a)||"0")},0)},ea=(i,e)=>{if(e==="width"||e==="height"){const t=i.getBoundingClientRect()[e];return tm(i)?`${t}px`:`${t-lc(i,e,"border")-lc(i,e,"padding")}px`}return Zo(i,e)},Dw=["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"];dt(["attr","prop","css"],(i,e)=>{const t=(n,s,o)=>{if(gt(o))return;if(e===0)return Zp(n,s,o);if(e===1){n[s]=o;return}s=Kp(s);const a=()=>s.startsWith("--")||Dw.includes(s)?"":"px";n.style.setProperty(s,Jo(o)?`${o}${a()}`:o)},r=(n,s)=>e===0?Qp(n,s):e===1?n[s]:ea(n,s);oe.fn[i]=function(n,s){if(Yi(n))return zt(n,(o,a)=>{this[i](o,a)}),this;if(arguments.length===1){const o=this[0];return tr(o)?r(o,n):void 0}return this.each((o,a)=>{t(a,n,vt(s)?s.call(a,o,r(a,n)):s)})}});oe.fn.children=function(i){const e=[];return this.each((t,r)=>{dt(r.childNodes,n=>{tr(n)&&(!i||oe(n).is(i))&&e.push(n)})}),new Bt(Vs(e))};oe.fn.slice=function(...i){return new Bt([].slice.apply(this,i))};oe.fn.eq=function(i){const e=i===-1?this.slice(i):this.slice(i,+i+1);return new Bt(e)};const yd=(i,e,t,r,n)=>{const s=[];let o;return i.each((a,c)=>{for(o=c[t];o&&tr(o);){if(e===2){if(r&&oe(o).is(r))break;(!n||oe(o).is(n))&&s.push(o)}else if(e===0){(!r||oe(o).is(r))&&s.push(o);break}else(!r||oe(o).is(r))&&s.push(o);o=o[t]}}),new Bt(Vs(s))};dt(["","s","sUntil"],(i,e)=>{oe.fn[`parent${i}`]=function(t,r){const n=e?oe(this.get().reverse()):this;return yd(n,e,"parentNode",t,r)}});oe.fn.closest=function(i){if(this.is(i))return this;const e=[];return this.parents().each((t,r)=>{if(oe(r).is(i))return e.push(r),!1}),new Bt(e)};const ta=new WeakMap,zs=i=>ta.get(i)??{},im=(i,e)=>{const t=zs(i),r=Qo(e);return r in t?t[r]:void 0},vd=(i,e)=>{const t=zs(i);zt(e,(r,n)=>{t[Qo(r)]=n}),ta.set(i,t)},rm=(i,e,t)=>{vd(i,{[e]:t})},Lw=i=>{ta.delete(i)},Ow=(i,e)=>{const t=zs(i);dt(e,r=>{const n=Qo(r);delete t[n]}),ta.set(i,t)},Pw=/^(?:{[\w\W]*\}|\[[\w\W]*\])$/,Mw=i=>i==="true"?!0:i==="false"?!1:i==="null"?null:i===+i+""?+i:Pw.test(i)?JSON.parse(i):i,If=(i,e,t)=>{if(gt(t)&&i.nodeType===1&&(t=i.dataset[e],wt(t)))try{t=Mw(t)}catch{}return t};oe.fn.data=function(i,e){if(gt(i)){if(!this.length)return;const t=this[0],r=zs(t);return t.nodeType!==1||zt(t.dataset,n=>{r[n]=If(t,n,r[n])}),r}if(Yi(i))return this.each(function(){vd(this,i)});if(arguments.length===2&&gt(e))return this;if(!gt(e))return this.each(function(){rm(this,i,e)});if(this.length)return If(this[0],Qo(i),im(this[0],i))};oe.fn.empty=function(){return this.each((i,e)=>{e.innerHTML=""})};oe.fn.extend=function(i){return zt(i,(e,t)=>{oe.fn[e]=t}),this};oe.fn.filter=function(i){if(vt(i))return this.map((t,r)=>i.call(r,t,r)?r:void 0);if(wt(i))return this.map((t,r)=>oe(r).is(i)?r:void 0);const e=oe(i);return this.map((t,r)=>e.get().includes(r)?r:void 0)};oe.fn.find=function(i){const e=[];return this.each((t,r)=>{bd(e,oe(r.querySelectorAll(i)).get())}),new Bt(e)};oe.fn.first=function(){return this.eq(0)};const wd=(i,e)=>i!==e&&Co(i).contains(e);oe.fn.has=function(i){const e=wt(i)?this.find(i):oe(i),{length:t}=e;return this.map(function(){for(let r=0;r<t;r+=1)if(wd(this,e[r]))return this})};oe.fn.hasClass=function(i){return this[0].classList.contains(i)};const nm=(i,e,t,r,n,s)=>{const o=a=>lc(i,e.toLowerCase(),a)*s;return r===2&&n&&(t+=o("margin")),tm(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},sm=(i,e,t,r)=>{const n=ii(),s=`client${e}`,o=`scroll${e}`,a=`offset${e}`,c=`inner${e}`;if(fd(i))return t===2?i[c]:Co(n)[s];if(pd(i)){const d=Co(i);return Math.max(i.body[o],d[o],i.body[a],d[a],d[s])}const l=parseFloat(Zo(i,e.toLowerCase())||"0");return nm(i,e,l,t,r,1)},Fw=(i,e,t,r,n,s)=>{let o=vt(s)?s.call(i,e,sm(i,t,r,n)):s;if(o==null)return;const a=oe(i),c=t.toLowerCase();if(wt(o)&&["auto","inherit",""].includes(o)){a.css(c,o);return}const l=o.toString().replace(/\b[0-9.]*/,""),d=parseFloat(o);o=nm(i,t,d,r,n,-1)+(l||"px"),a.css(c,o)};dt(["Width","Height"],i=>{dt([`inner${i}`,i.toLowerCase(),`outer${i}`],(e,t)=>{oe.fn[e]=function(r,n){const s=arguments.length&&(t<2||!Cw(r)),o=r===!0||n===!0;return s?this.each((a,c)=>Fw(c,a,i,t,o,r)):this.length?sm(this[0],i,t,o):void 0}})});oe.fn.hide=function(){return this.each((i,e)=>{e.style.display="none"})};dt(["val","html","text"],(i,e)=>{const r=["value","innerHTML","textContent"][e],n=o=>{if(e===2)return ws(o,l=>Co(l)[r]).join("");if(!o.length)return;const a=o[0],c=oe(a);return e===0&&c.is("select[multiple]")?ws(c.find("option:checked"),l=>l.value):a[r]},s=(o,a)=>{if(gt(a)){if(e!==0)return;a=""}e===1&&tr(a)&&(a=a.outerHTML),o[r]=a};oe.fn[i]=function(o){return arguments.length?this.each((a,c)=>{const l=oe(c),d=vt(o)?o.call(c,a,n(l)):o;e===0&&Array.isArray(d)?l.is("select[multiple]")?ws(l.find("option"),u=>u.selected=d.includes(u.value)):c.checked=d.includes(c.value):s(c,d)}):n(this)}});oe.fn.index=function(i){return arguments.length?wt(i)?oe(i).get().indexOf(this[0]):this.get().indexOf(oe(i)[0]):this.eq(0).parent().children().get().indexOf(this[0])};oe.fn.last=function(){return this.eq(-1)};dt(["","All","Until"],(i,e)=>{oe.fn[`next${i}`]=function(t,r){return yd(this,e,"nextElementSibling",t,r)}});oe.fn.not=function(i){const e=this.filter(i);return this.map((t,r)=>e.index(r)>-1?void 0:r)};const jw=Er().CustomEvent;class Bw extends jw{constructor(e,t){super(e,t),this.data=t.data,this.namespace=t.namespace}}const Ul=new WeakMap;let qw=1;const cc=i=>(Ul.has(i)||Ul.set(i,++qw),Ul.get(i)),Tf=new Map,Ao=i=>{const e=cc(i);return Tf.get(e)||Tf.set(e,[]).get(e)},_d=i=>{const e=i.split(".");return{type:e[0],namespace:e.slice(1).sort().join(" ")}},om=i=>new RegExp("(?:^| )"+i.replace(" "," .* ?")+"(?: |$)"),Uw=(i,e,t,r)=>{const n=_d(e);return Ao(i).filter(s=>s&&(!n.type||s.type===n.type)&&(!n.namespace||om(n.namespace).test(s.namespace))&&(!t||cc(s.func)===cc(t))&&(!r||s.selector===r))},Vw=(i,e,t,r,n)=>{let s=!1;Yi(r)&&r.useCapture&&(s=!0),e.split(" ").forEach(o=>{if(!o)return;const a=_d(o),c=(u,p)=>{t.apply(p,u.detail===null?[u]:[u].concat(u.detail))===!1&&(u.preventDefault(),u.stopPropagation())},l=u=>{u.namespace&&!om(u.namespace).test(a.namespace)||(u.data=r,n?oe(i).find(n).get().reverse().forEach(p=>{(p===u.target||wd(p,u.target))&&c(u,p)}):c(u,i))},d={type:a.type,namespace:a.namespace,func:t,selector:n,id:Ao(i).length,proxy:l};Ao(i).push(d),i.addEventListener(d.type,l,s)})},zw=(i,e,t,r)=>{const n=Ao(i),s=o=>{delete n[o.id],i.removeEventListener(o.type,o.proxy,!1)};e?e.split(" ").forEach(o=>{o&&Uw(i,o,t,r).forEach(a=>{s(a)})}):n.forEach(o=>{s(o)})};oe.fn.off=function(i,e,t){return Yi(i)?(zt(i,(r,n)=>{this.off(r,e,n)}),this):((e===!1||vt(e))&&(t=e,e=void 0),t===!1&&(t=Xp),this.each(function(){zw(this,i,t,e)}))};function ia(i,...e){return dt(e,t=>{zt(t,(r,n)=>{gt(n)||(i[r]=n)})}),i}oe.fn.offsetParent=function(){const i=ii();return this.map(function(){let e=this.offsetParent;for(;e&&oe(e).css("position")==="static";)e=e.offsetParent;return e||i.documentElement})};const lo=(i,e)=>parseFloat(i.css(e));oe.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+=lo(r,"border-top-width"),t.left+=lo(r,"border-left-width")}return{top:e.top-t.top-lo(i,"margin-top"),left:e.left-t.left-lo(i,"margin-left")}};const am=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}},Hw=(i,e,t)=>{const r=oe(i),n=r.css("position");n==="static"&&r.css("position","relative");const s=am(i),o=r.css("top"),a=r.css("left");let c,l;if((n==="absolute"||n==="fixed")&&(o+a).includes("auto")){const p=r.position();c=p.top,l=p.left}else c=parseFloat(o),l=parseFloat(a);const u=vt(e)?e.call(i,t,ia({},s)):e;r.css({top:u.top!=null?u.top-s.top+c:void 0,left:u.left!=null?u.left-s.left+l:void 0})};oe.fn.offset=function(i){return arguments.length?this.each(function(e){Hw(this,i,e)}):this.length?am(this[0]):void 0};oe.fn.on=function(i,e,t,r,n){if(Yi(i))return wt(e)||(t=t||e,e=void 0),zt(i,(s,o)=>{this.on(s,e,t,o,n)}),this;if(t==null&&r==null?(r=e,t=e=void 0):r==null&&(wt(e)?(r=t,t=void 0):(r=t,t=e,e=void 0)),r===!1)r=Xp;else if(!r)return this;if(n){const s=this,o=r;r=function(a,...c){return s.off(a.type,e,r),o.call(this,a,...c)}}return this.each(function(){Vw(this,i,r,t,e)})};oe.fn.one=function(i,e,t,r){return this.on(i,e,t,r,!0)};dt(["","All","Until"],(i,e)=>{oe.fn[`prev${i}`]=function(t,r){const n=e?oe(this.get().reverse()):this;return yd(n,e,"previousElementSibling",t,r)}});oe.fn.removeAttr=function(i){const e=i.split(" ").filter(t=>t);return this.each(function(){dt(e,t=>{Yp(this,t)})})};const lm=(i,e)=>{if(gt(e))return Lw(i);const t=wt(e)?e.split(" ").filter(r=>r):e;Ow(i,t)};oe.fn.removeData=function(i){return this.each((e,t)=>{lm(t,i)})};oe.fn.removeProp=function(i){return this.each((e,t)=>{try{delete t[i]}catch{}})};oe.fn.replaceWith=function(i){return this.each((e,t)=>{let r=i;vt(r)?r=r.call(t,e,t.innerHTML):e&&!wt(r)&&(r=oe(r).clone()),oe(t).before(r)}),this.remove()};oe.fn.replaceAll=function(i){return oe(i).map((e,t)=>(oe(t).replaceWith(e?this.clone():this),this.get()))};const xd=i=>{if(!Yi(i)&&!Array.isArray(i))return"";const e=[],t=(r,n)=>{let s;Yi(n)?zt(n,(o,a)=>{s=Array.isArray(n)&&!Yi(a)?"":o,t(`${r}[${s}]`,a)}):(s=n==null||n===""?"=":`=${encodeURIComponent(n)}`,e.push(encodeURIComponent(r)+s))};return Array.isArray(i)?dt(i,({name:r,value:n})=>t(r,n)):zt(i,t),e.join("&")},ln=new WeakMap,cm=i=>{const e=[...i.elements],t=ln.get(i)||[],r=(n,s)=>n.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1;return[...e,...t].sort(r)},dm=i=>{const e=[];return i.each((t,r)=>{const n=r instanceof HTMLFormElement?cm(r):[r];oe(n).each((s,o)=>{const a=oe(o),c=o.type,l=o.nodeName.toLowerCase();l!=="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(l)&&!["submit","button","image","reset","file"].includes(c)&&(!["radio","checkbox"].includes(c)||o.checked)&&(!["mdui-checkbox","mdui-switch"].includes(l)||o.checked)&&e.push({name:o.name,value:a.val()})})}),e};oe.fn.serializeArray=function(){return dm(this).map(i=>Array.isArray(i.value)?i.value.map(e=>({name:i.name,value:e})):i).flat()};oe.fn.serialize=function(){return xd(this.serializeArray())};oe.fn.serializeObject=function(){const i={};return dm(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 Vl={},Ww=i=>{const e=ii();let t,r;return Vl[i]||(t=Yo(i),md(e.body,t),r=ea(t,"display"),gd(t),r==="none"&&(r="block"),Vl[i]=r),Vl[i]};oe.fn.show=function(){return this.each((i,e)=>{e.style.display==="none"&&(e.style.display=""),ea(e,"display")==="none"&&(e.style.display=Ww(e.nodeName))})};oe.fn.siblings=function(i){return this.prevAll(i).add(this.nextAll(i))};oe.fn.toggle=function(){return this.each((i,e)=>{ea(e,"display")==="none"?oe(e).show():oe(e).hide()})};oe.fn.trigger=function(i,e=null,t){const{type:r,namespace:n}=_d(i),s=new Bw(r,{detail:e,data:null,namespace:n,bubbles:!0,cancelable:!1,composed:!0,...t});return this.each((o,a)=>{a.dispatchEvent(s)})};const Gw="ajaxStart",Cf="ajaxSuccess",co="ajaxError",zl="ajaxComplete",_s={},Kw=i=>["GET","HEAD"].includes(i),$f=(i,e)=>`${i}&${e}`.replace(/[&?]{1,2}/,"?"),Xw=i=>{const e=Er();return/^([\w-]+:)?\/\/([^/]+)/.test(i)&&RegExp.$2!==e.location.host},Jw=i=>i>=200&&i<300||[0,304].includes(i),Qw=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 zt(_s,(t,r)=>{!["beforeSend","success","error","complete","statusCode"].includes(t)&&!gt(r)&&(e[t]=r)}),ia({},e,i)},um=i=>{const e=ii(),t=Er();let r=!1;const n={},s={},o=Qw(i),a=o.method.toUpperCase();let{data:c,url:l}=o;l=l||t.location.toString();const{processData:d,async:u,cache:p,username:g,password:v,headers:_,xhrFields:E,statusCode:x,dataType:k,contentType:y,timeout:h,global:m}=o,T=Kw(a);c&&(T||d)&&!wt(c)&&!(c instanceof ArrayBuffer)&&!(c instanceof Blob)&&!(c instanceof Document)&&!(c instanceof FormData)&&(c=xd(c)),c&&T&&(l=$f(l,c),c=null);const N=(F,I,...O)=>{m&&oe(e).trigger(F,I==="success"?s:n);let U,R;I in _s&&(U=_s[I](...O)),o[I]&&(R=o[I](...O)),I==="beforeSend"&&[U,R].includes(!1)&&(r=!0)};return(()=>{let F;return new Promise((I,O)=>{const U=Q=>O(new Error(Q));T&&!p&&(l=$f(l,`_=${Date.now()}`));const R=new XMLHttpRequest;R.open(a,l,u,g,v),(y||c&&!T&&y!==!1)&&R.setRequestHeader("Content-Type",y),k==="json"&&R.setRequestHeader("Accept","application/json, text/javascript"),zt(_,(Q,$)=>{gt($)||R.setRequestHeader(Q,$+"")}),Xw(l)||R.setRequestHeader("X-Requested-With","XMLHttpRequest"),zt(E,(Q,$)=>{R[Q]=$}),n.xhr=s.xhr=R,n.options=s.options=o;let D;if(R.onload=()=>{D&&clearTimeout(D);const Q=Jw(R.status);let $;if(Q)if(F=R.status===204||a==="HEAD"?"nocontent":R.status===304?"notmodified":"success",k==="json"||!k&&(R.getResponseHeader("content-type")||"").includes("json")){try{$=a==="HEAD"?void 0:JSON.parse(R.responseText),s.response=$}catch{F="parsererror",N(co,"error",R,F),U(F)}F!=="parsererror"&&(N(Cf,"success",$,F,R),I($))}else $=a==="HEAD"?void 0:R.responseType==="text"||R.responseType===""?R.responseText:R.response,s.response=$,N(Cf,"success",$,F,R),I($);else F="error",N(co,"error",R,F),U(F);dt([_s.statusCode??{},x],Y=>{Y[R.status]&&(Q?Y[R.status]($,F,R):Y[R.status](R,F))}),N(zl,"complete",R,F)},R.onerror=()=>{D&&clearTimeout(D),N(co,"error",R,R.statusText),N(zl,"complete",R,"error"),U(R.statusText)},R.onabort=()=>{let Q="abort";D&&(Q="timeout",clearTimeout(D)),N(co,"error",R,Q),N(zl,"complete",R,Q),U(Q)},N(Gw,"beforeSend",R,o),r)return U("cancel");h>0&&(D=t.setTimeout(()=>R.abort(),h)),R.send(c)})})()};oe.ajax=um;const Yw=i=>ia(_s,i);oe.ajaxSetup=Yw;oe.contains=wd;function Zw(i,e,t){return Yi(e)?(vd(i,e),e):gt(t)?gt(e)?zs(i):im(i,e):(rm(i,e,t),t)}oe.data=Zw;oe.each=em;oe.extend=function(i,...e){return e.length?ia(i,...e):(zt(i,(t,r)=>{this[t]=r}),this)};oe.map=ws;oe.merge=bd;oe.param=xd;oe.removeData=lm;oe.unique=Vs;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}/**
352
377
  * @license
353
378
  * Copyright 2017 Google LLC
354
379
  * SPDX-License-Identifier: BSD-3-Clause
355
- */const Re=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};/**
380
+ */const Ae=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};/**
356
381
  * @license
357
382
  * Copyright 2017 Google LLC
358
383
  * SPDX-License-Identifier: BSD-3-Clause
359
- */const dw={attribute:!0,type:String,converter:zr,reflect:!1,hasChanged:gc},uw=(i=dw,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"?uw(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)}/**
384
+ */const e1={attribute:!0,type:String,converter:pn,reflect:!1,hasChanged:zc},t1=(i=e1,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 c=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,c,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 c=this[o];e.call(this,a),this.requestUpdate(o,c,i)}}throw Error("Unsupported decorator location: "+r)};function L(i){return(e,t)=>typeof t=="object"?t1(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)}/**
360
385
  * @license
361
386
  * Copyright 2017 Google LLC
362
387
  * SPDX-License-Identifier: BSD-3-Clause
363
- */function Oe(i){return D({...i,state:!0,attribute:!1})}/**
388
+ */function Be(i){return L({...i,state:!0,attribute:!1})}/**
364
389
  * @license
365
390
  * Copyright 2017 Google LLC
366
391
  * SPDX-License-Identifier: BSD-3-Clause
367
- */const hw=(i,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(i,e,t),t);/**
392
+ */const i1=(i,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(i,e,t),t);/**
368
393
  * @license
369
394
  * Copyright 2021 Google LLC
370
395
  * SPDX-License-Identifier: BSD-3-Clause
371
- */function ni(i){return(e,t)=>{const{slot:r,selector:n}=i??{},s="slot"+(r?`[name=${r}]`:":not([name])");return hw(e,t,{get(){const o=this.renderRoot?.querySelector(s),a=o?.assignedElements(i)??[];return n===void 0?a:a.filter(l=>l.matches(n))}})}}/**
396
+ */function gi(i){return(e,t)=>{const{slot:r,selector:n}=i??{},s="slot"+(r?`[name=${r}]`:":not([name])");return i1(e,t,{get(){const o=this.renderRoot?.querySelector(s),a=o?.assignedElements(i)??[];return n===void 0?a:a.filter(c=>c.matches(n))}})}}/**
372
397
  * @license
373
398
  * Copyright 2018 Google LLC
374
399
  * SPDX-License-Identifier: BSD-3-Clause
375
- */const De=i=>i??Ge;/**
400
+ */const je=i=>i??it;/**
376
401
  * @license
377
402
  * Copyright 2017 Google LLC
378
403
  * SPDX-License-Identifier: BSD-3-Clause
379
- */const ki={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},un=i=>(...e)=>({_$litDirective$:i,values:e});let bs=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)}};/**
404
+ */const Mi={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Ln=i=>(...e)=>({_$litDirective$:i,values:e});let Hs=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)}};/**
380
405
  * @license
381
406
  * Copyright 2018 Google LLC
382
407
  * SPDX-License-Identifier: BSD-3-Clause
383
- */const $p="important",fw=" !"+$p,wr=un(class extends bs{constructor(i){if(super(i),i.type!==ki.ATTRIBUTE||i.name!=="style"||i.strings?.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(fw);r.includes("-")||s?t.setProperty(r,s?n.slice(0,-11):n,s?$p:""):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),Ys()||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=Q`${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}`;/**
408
+ */const hm="important",r1=" !"+hm,jr=Ln(class extends Hs{constructor(i){if(super(i),i.type!==Mi.ATTRIBUTE||i.name!=="style"||i.strings?.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(r1);r.includes("-")||s?t.setProperty(r,s?n.slice(0,-11):n,s?hm:""):t[r]=n}}return Vt}});class Ke extends yt{emit(e,t){const r=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(r)}}class $t{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),$o()||oe(()=>{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 Qe=Z`${it}`,qe=$e`: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}`;/**
384
409
  * @license
385
410
  * Copyright 2017 Google LLC
386
411
  * SPDX-License-Identifier: BSD-3-Clause
387
- */let Ml=class extends bs{constructor(e){if(super(e),this.it=Ge,e.type!==ki.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:[]}}};Ml.directiveName="unsafeHTML",Ml.resultType=1;/**
412
+ */let dc=class extends Hs{constructor(e){if(super(e),this.it=it,e.type!==Mi.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===it||e==null)return this._t=void 0,this.it=e;if(e===Vt)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:[]}}};dc.directiveName="unsafeHTML",dc.resultType=1;/**
388
413
  * @license
389
414
  * Copyright 2017 Google LLC
390
415
  * SPDX-License-Identifier: BSD-3-Clause
391
- */class Pl extends Ml{}Pl.directiveName="unsafeSVG",Pl.resultType=2;const Cp=un(Pl);/**
416
+ */class uc extends dc{}uc.directiveName="unsafeSVG",uc.resultType=2;const fm=Ln(uc);/**
392
417
  * @license
393
418
  * Copyright 2020 Google LLC
394
419
  * SPDX-License-Identifier: BSD-3-Clause
395
- */const pw=i=>i===null||typeof i!="object"&&typeof i!="function",Ap=i=>i.strings===void 0,mw={},gw=(i,e=mw)=>i._$AH=e;/**
420
+ */const n1=i=>i===null||typeof i!="object"&&typeof i!="function",pm=i=>i.strings===void 0,s1={},o1=(i,e=s1)=>i._$AH=e;/**
396
421
  * @license
397
422
  * Copyright 2017 Google LLC
398
423
  * SPDX-License-Identifier: BSD-3-Clause
399
- */const Qn=(i,e)=>{const t=i._$AN;if(t===void 0)return!1;for(const r of t)r._$AO?.(e,!1),Qn(r,e);return!0},eo=i=>{let e,t;do{if((e=i._$AM)===void 0)break;t=e._$AN,t.delete(i),i=e}while(t?.size===0)},Np=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),vw(e)}};function yw(i){this._$AN!==void 0?(eo(this),this._$AM=i,Np(this)):this._$AM=i}function bw(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),eo(r[s]);else r!=null&&(Qn(r,!1),eo(r));else Qn(this,i)}const vw=i=>{i.type==ki.CHILD&&(i._$AP??=bw,i._$AQ??=yw)};class Lp extends bs{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),Np(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Qn(this,e),eo(this))}setValue(e){if(Ap(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(){}}/**
424
+ */const xs=(i,e)=>{const t=i._$AN;if(t===void 0)return!1;for(const r of t)r._$AO?.(e,!1),xs(r,e);return!0},No=i=>{let e,t;do{if((e=i._$AM)===void 0)break;t=e._$AN,t.delete(i),i=e}while(t?.size===0)},mm=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),c1(e)}};function a1(i){this._$AN!==void 0?(No(this),this._$AM=i,mm(this)):this._$AM=i}function l1(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++)xs(r[s],!1),No(r[s]);else r!=null&&(xs(r,!1),No(r));else xs(this,i)}const c1=i=>{i.type==Mi.CHILD&&(i._$AP??=l1,i._$AQ??=a1)};class gm extends Hs{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),mm(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(xs(this,e),No(this))}setValue(e){if(pm(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(){}}/**
400
425
  * @license
401
426
  * Copyright 2021 Google LLC
402
427
  * SPDX-License-Identifier: BSD-3-Clause
403
- */class ww{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}}class _w{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(e=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}}/**
428
+ */class d1{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}}class u1{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(e=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}}/**
404
429
  * @license
405
430
  * Copyright 2017 Google LLC
406
431
  * SPDX-License-Identifier: BSD-3-Clause
407
- */const Qh=i=>!pw(i)&&typeof i.then=="function",Xh=1073741823;class xw extends Lp{constructor(){super(...arguments),this._$Cwt=Xh,this._$Cbt=[],this._$CK=new ww(this),this._$CX=new _w}render(...e){return e.find(t=>!Qh(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(!Qh(l))return this._$Cwt=a,l;a<n&&l===r[a]||(this._$Cwt=Xh,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 Ew=un(xw),Sw=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 ss=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 Q`<span translate="no" style="${wr({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?Q`${Ew(Tp({url:this.src}).then(Cp))}`:Q``};return this.hasSlotController.test("[default]")?Q`<slot></slot>`:e()}};ss.styles=[Me,Sw];w([D({reflect:!0})],ss.prototype,"name",void 0);w([D({reflect:!0})],ss.prototype,"src",void 0);ss=w([Re("mdui-icon")],ss);const kw=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 Rr=class extends Ue{constructor(){super(...arguments),this.hasSlotController=new bt(this,"[default]")}render(){return this.hasSlotController.test("[default]")?Q`<slot></slot>`:this.src?Q`<img part="image" alt="${De(this.label)}" src="${this.src}" style="${wr({objectFit:this.fit})}">`:this.icon?Q`<mdui-icon part="icon" name="${this.icon}"></mdui-icon>`:He}};Rr.styles=[Me,kw];w([D({reflect:!0})],Rr.prototype,"src",void 0);w([D({reflect:!0})],Rr.prototype,"fit",void 0);w([D({reflect:!0})],Rr.prototype,"icon",void 0);w([D({reflect:!0})],Rr.prototype,"label",void 0);Rr=w([Re("mdui-avatar")],Rr);const Iw=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 to=class extends Ue{constructor(){super(...arguments),this.variant="large"}render(){return this.variant==="small"?He:Q`<slot></slot>`}};to.styles=[Me,Iw];w([D({reflect:!0})],to.prototype,"variant",void 0);to=w([Re("mdui-badge")],to);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||Ys())&&!this.getUndefinedLocalNames().length,this.defined)}async whenDefined(){if(this.defined)return Promise.resolve();const e=zt();this.needDomReady&&!Ys(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 gs(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 Ls=new WeakMap,Jc=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=ms(this.parentElement,"mdui-layout"),this.setContainerPadding("add",this.scrollTarget)})}disconnectedCallback(){super.disconnectedCallback(),this.scrollBehaviorDefinedController.whenDefined().then(()=>{this.setContainerPadding("remove",this.scrollTarget)})}hasScrollBehavior(r){const n=this.scrollBehavior?.split(" ")??[];return Array.isArray(r)?!!n.filter(s=>r.includes(s)).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=Ls.get(s)??{top:[],bottom:[]};c[o].push(this),Ls.set(s,c)}}if(r==="remove"){const l=Ls.get(s);if(!l)return;const c=l[o].indexOf(this);c>-1&&(l[o].splice(c,1),Ls.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 Rw=0;const lr=()=>++Rw;let Qi,ml;const cr=(i,e)=>{const t=se(i),r=lr(),n={unobserve:()=>{t.each((s,o)=>{const a=Qi.get(o),l=a.coArr.findIndex(c=>c.key===r);l!==-1&&a.coArr.splice(l,1),a.coArr.length?Qi.set(o,a):(ml.unobserve(o),Qi.delete(o))})}};return Qi||(Qi=new WeakMap,ml=new ResizeObserver(s=>{s.forEach(o=>{const a=o.target,l=Qi.get(a);l.entry=o,l.coArr.forEach(c=>{c.callback.call(n,o,n)})})})),t.each((s,o)=>{const a=Qi.get(o)??{coArr:[]};a.coArr.length&&a.entry&&e.call(n,a.entry,n),a.coArr.push({callback:e,key:r}),Qi.set(o,a),ml.observe(o)}),n};class Tw{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){const t=this.states.findIndex(n=>n.element===e);if(t<0)return;this.states[t].observeResize?.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?.width,height: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?.top??0,f=c?.right??0,g=c?.bottom??0,y=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 ms(e.element,"mdui-navigation-drawer")&&e.element.isModal}}const gl=new WeakMap,Dp=i=>(gl.has(i)||gl.set(i,new Tw),gl.get(i));class dr extends Ue{constructor(){super(...arguments),this.isParentLayout=!1}get layoutPlacement(){throw new Error("Must implement placement getter!")}onOrderChange(){this.layoutManager?.updateOrder()}connectedCallback(){super.connectedCallback();const e=this.parentElement;this.isParentLayout=ms(e,"mdui-layout"),this.isParentLayout&&(this.layoutManager=Dp(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 $w=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 Jc(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 Q`<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,$w];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);/**
432
+ */const Af=i=>!n1(i)&&typeof i.then=="function",Nf=1073741823;class h1 extends gm{constructor(){super(...arguments),this._$Cwt=Nf,this._$Cbt=[],this._$CK=new d1(this),this._$CX=new u1}render(...e){return e.find(t=>!Af(t))??Vt}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 c=t[a];if(!Af(c))return this._$Cwt=a,c;a<n&&c===r[a]||(this._$Cwt=Nf,n=0,Promise.resolve(c).then(async l=>{for(;o.get();)await o.get();const d=s.deref();if(d!==void 0){const u=d._$Cbt.indexOf(c);u>-1&&u<d._$Cwt&&(d._$Cwt=u,d.setValue(l))}}))}return Vt}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}const f1=Ln(h1),p1=$e`: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 Ke{constructor(){super(...arguments),this.hasSlotController=new $t(this,"[default]")}render(){const e=()=>{if(this.name){const[t,r]=this.name.split("--");return Z`<span translate="no" style="${jr({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?Z`${f1(um({url:this.src}).then(fm))}`:Z``};return this.hasSlotController.test("[default]")?Z`<slot></slot>`:e()}};As.styles=[qe,p1];w([L({reflect:!0})],As.prototype,"name",void 0);w([L({reflect:!0})],As.prototype,"src",void 0);As=w([Ae("mdui-icon")],As);const m1=$e`: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 Hr=class extends Ke{constructor(){super(...arguments),this.hasSlotController=new $t(this,"[default]")}render(){return this.hasSlotController.test("[default]")?Z`<slot></slot>`:this.src?Z`<img part="image" alt="${je(this.label)}" src="${this.src}" style="${jr({objectFit:this.fit})}">`:this.icon?Z`<mdui-icon part="icon" name="${this.icon}"></mdui-icon>`:Qe}};Hr.styles=[qe,m1];w([L({reflect:!0})],Hr.prototype,"src",void 0);w([L({reflect:!0})],Hr.prototype,"fit",void 0);w([L({reflect:!0})],Hr.prototype,"icon",void 0);w([L({reflect:!0})],Hr.prototype,"label",void 0);Hr=w([Ae("mdui-avatar")],Hr);const g1=$e`: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 Do=class extends Ke{constructor(){super(...arguments),this.variant="large"}render(){return this.variant==="small"?Qe:Z`<slot></slot>`}};Do.styles=[qe,g1];w([L({reflect:!0})],Do.prototype,"variant",void 0);Do=w([Ae("mdui-badge")],Do);const we=i=>i!==null&&i.toLowerCase()!=="false";class At{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||$o())&&!this.getUndefinedLocalNames().length,this.defined)}async whenDefined(){if(this.defined)return Promise.resolve();const e=ii();this.needDomReady&&!$o(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?[...ii().querySelectorAll(t)]:[],s=[...r,...n].map(o=>o.localName);return Vs(s)}onSlotChange(){const e=this.getScopeLocalNameSelector();e&&this.host.querySelectorAll(e).length&&(this.defined=!1)}}function Re(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 uo=new WeakMap,Ed=i=>{class e extends i{constructor(...r){super(...r),this.scrollBehaviorDefinedController=new At(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=Us(this.parentElement,"mdui-layout"),this.setContainerPadding("add",this.scrollTarget)})}disconnectedCallback(){super.disconnectedCallback(),this.scrollBehaviorDefinedController.whenDefined().then(()=>{this.setContainerPadding("remove",this.scrollTarget)})}hasScrollBehavior(r){const n=this.scrollBehavior?.split(" ")??[];return Array.isArray(r)?!!n.filter(s=>r.includes(s)).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 c=["fixed","absolute"].includes(oe(this).css("position"))?this.offsetHeight:null;if(oe(s).css({[a]:c}),r==="add"&&c!==null){const l=uo.get(s)??{top:[],bottom:[]};l[o].push(this),uo.set(s,l)}}if(r==="remove"){const c=uo.get(s);if(!c)return;const l=c[o].indexOf(this);l>-1&&(c[o].splice(l,1),uo.set(s,c)),c[o].length||oe(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?oe(r)[0]:window}getContainer(r){return r?oe(r)[0]:document.body}}return w([L({attribute:"scroll-target"})],e.prototype,"scrollTarget",void 0),w([L({reflect:!0,attribute:"scroll-behavior"})],e.prototype,"scrollBehavior",void 0),w([L({type:Number,reflect:!0,attribute:"scroll-threshold"})],e.prototype,"scrollThreshold",void 0),w([Re("scrollTarget")],e.prototype,"onScrollTargetChange",null),w([Re("scrollBehavior")],e.prototype,"onScrollBehaviorChange",null),e};let b1=0;const Sr=()=>++b1;let hr,Hl;const kr=(i,e)=>{const t=oe(i),r=Sr(),n={unobserve:()=>{t.each((s,o)=>{const a=hr.get(o),c=a.coArr.findIndex(l=>l.key===r);c!==-1&&a.coArr.splice(c,1),a.coArr.length?hr.set(o,a):(Hl.unobserve(o),hr.delete(o))})}};return hr||(hr=new WeakMap,Hl=new ResizeObserver(s=>{s.forEach(o=>{const a=o.target,c=hr.get(a);c.entry=o,c.coArr.forEach(l=>{l.callback.call(n,o,n)})})})),t.each((s,o)=>{const a=hr.get(o)??{coArr:[]};a.coArr.length&&a.entry&&e.call(n,a.entry,n),a.coArr.push({callback:e,key:r}),hr.set(o,a),Hl.observe(o)}),n};class y1{constructor(){this.states=[]}registerMain(e){this.$main=oe(e)}unregisterMain(){this.$main=void 0}registerItem(e){const t={element:e};this.states.push(t),t.observeResize=kr(t.element,()=>{this.updateLayout(t.element,{width:this.isNoWidth(t)?0:void 0})}),this.items=void 0,this.resort(),this.updateLayout()}unregisterItem(e){const t=this.states.findIndex(n=>n.element===e);if(t<0)return;this.states[t].observeResize?.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?.width,height: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 c=o.element.layoutPlacement,l=a>0?this.states[a-1]:void 0,d=l?.top??0,u=l?.right??0,p=l?.bottom??0,g=l?.left??0;switch(Object.assign(o,{top:d,right:u,bottom:p,left:g}),c){case"top":case"bottom":o[c]+=o.height??o.element.offsetHeight;break;case"right":case"left":o[c]+=(this.isNoWidth(o)?0:o.width)??o.element.offsetWidth;break}o.height=o.width=void 0,oe(o.element).css({position:"absolute",top:c==="bottom"?null:d,right:c==="left"?null:u,bottom:c==="top"?null:p,left:c==="right"?null:g})});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 Us(e.element,"mdui-navigation-drawer")&&e.element.isModal}}const Wl=new WeakMap,bm=i=>(Wl.has(i)||Wl.set(i,new y1),Wl.get(i));class Rr extends Ke{constructor(){super(...arguments),this.isParentLayout=!1}get layoutPlacement(){throw new Error("Must implement placement getter!")}onOrderChange(){this.layoutManager?.updateOrder()}connectedCallback(){super.connectedCallback();const e=this.parentElement;this.isParentLayout=Us(e,"mdui-layout"),this.isParentLayout&&(this.layoutManager=bm(e),this.layoutManager.registerItem(this))}disconnectedCallback(){super.disconnectedCallback(),this.layoutManager&&this.layoutManager.unregisterItem(this)}}w([L({type:Number,reflect:!0})],Rr.prototype,"order",void 0);w([Re("order",!0)],Rr.prototype,"onOrderChange",null);const v1=$e`: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 xn=class extends Ed(Rr){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 Z`<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)}};xn.styles=[qe,v1];w([L({type:Boolean,reflect:!0,converter:we})],xn.prototype,"hide",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"fab-detach"})],xn.prototype,"fabDetach",void 0);w([L({reflect:!0,attribute:"scroll-behavior"})],xn.prototype,"scrollBehavior",void 0);xn=w([Ae("mdui-bottom-app-bar")],xn);/**
408
433
  * @license
409
434
  * Copyright 2020 Google LLC
410
435
  * SPDX-License-Identifier: BSD-3-Clause
411
- */const Ne=()=>new Cw;class Cw{}const yl=new WeakMap,$e=un(class extends Lp{render(i){return Ge}update(i,[e]){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=i.options?.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=yl.get(e);t===void 0&&(t=new WeakMap,yl.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(){return typeof this.G=="function"?yl.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function Ti(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=Ti(i[t]))!==""&&(e+=(e&&" ")+r);else for(let t in i)i[t]&&(e+=(e&&" ")+t);return e}const Mn=new WeakMap,ht=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,jr.has(this.form)?jr.get(this.form).add(this.host):jr.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&&(jr.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)&&!jr.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,ht.has(this.form)?ht.get(this.form).add(this.host):ht.set(this.form,new Set([this.host])))}reportFormValidity(){if(this.form&&!this.form.noValidate){const e=Ip(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=Q`<slot></slot>`,refDirective:a,tabIndex:l}){return Q`<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 Qc=!0;const Op=zt();Op.addEventListener("pointerdown",()=>{Qc=!0});Op.addEventListener("keydown",()=>{Qc=!1});const si=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=!Qc}),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};/**
436
+ */const Me=()=>new w1;class w1{}const Gl=new WeakMap,De=Ln(class extends gm{render(i){return it}update(i,[e]){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=i.options?.host,this.rt(this.ct=i.element)),it}rt(i){if(this.isConnected||(i=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=Gl.get(e);t===void 0&&(t=new WeakMap,Gl.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(){return typeof this.G=="function"?Gl.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function Bi(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=Bi(i[t]))!==""&&(e+=(e&&" ")+r);else for(let t in i)i[t]&&(e+=(e&&" ")+t);return e}const cs=new WeakMap,xt=new WeakMap;class lr{constructor(e,t){(this.host=e).addController(this),this.definedController=new At(e,{needDomReady:!0}),this.options={form:r=>{const n=oe(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=>vt(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,ln.has(this.form)?ln.get(this.form).add(this.host):ln.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),cs.has(this.form)||(cs.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())}detachForm(){this.form&&(ln.get(this.form).delete(this.host),this.form.removeEventListener("formdata",this.onFormData),this.form.removeEventListener("submit",this.onFormSubmit),this.form.removeEventListener("reset",this.onFormReset),cs.has(this.form)&&!ln.get(this.form).size&&(this.form.reportValidity=cs.get(this.form),cs.delete(this.form)))}doAction(e,t){if(!this.form)return;const r=oe(`<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,oe(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&&wt(r)&&r&&!gt(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,xt.has(this.form)?xt.get(this.form).add(this.host):xt.set(this.form,new Set([this.host])))}reportFormValidity(){if(this.form&&!this.form.noValidate){const e=cm(this.form);for(const t of e)if(vt(t.reportValidity)&&!t.reportValidity())return!1}return!0}}const On=i=>{class e extends i{renderAnchor({id:r,className:n,part:s,content:o=Z`<slot></slot>`,refDirective:a,tabIndex:c}){return Z`<a ${a} id="${je(r)}" class="_a ${n||""}" part="${je(s)}" href="${je(this.href)}" download="${je(this.download)}" target="${je(this.target)}" rel="${je(this.rel)}" tabindex="${je(c)}">${o}</a>`}}return w([L({reflect:!0})],e.prototype,"href",void 0),w([L({reflect:!0})],e.prototype,"download",void 0),w([L({reflect:!0})],e.prototype,"target",void 0),w([L({reflect:!0})],e.prototype,"rel",void 0),e};let Sd=!0;const ym=ii();ym.addEventListener("pointerdown",()=>{Sd=!0});ym.addEventListener("keydown",()=>{Sd=!1});const bi=i=>{class e extends i{constructor(){super(...arguments),this.autofocus=!1,this.focused=!1,this.focusVisible=!1,this.focusableDefinedController=new At(this,{relatedElements:[""]}),this._manipulatingTabindex=!1,this._tabIndex=0}get tabIndex(){const r=oe(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=oe(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=!Sd}),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=oe(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([L({type:Boolean,reflect:!0,converter:we})],e.prototype,"autofocus",void 0),w([L({type:Boolean,reflect:!0,converter:we})],e.prototype,"focused",void 0),w([L({type:Boolean,reflect:!0,converter:we,attribute:"focus-visible"})],e.prototype,"focusVisible",void 0),w([L({type:Number,attribute:"tabindex"})],e.prototype,"tabIndex",null),e};/**
412
437
  * @license
413
438
  * Copyright 2018 Google LLC
414
439
  * SPDX-License-Identifier: BSD-3-Clause
415
- */const lt=un(class extends bs{constructor(i){if(super(i),i.type!==ki.ATTRIBUTE||i.name!=="class"||i.strings?.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]){if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in e)e[r]&&!this.nt?.has(r)&&this.st.add(r);return this.render(e)}const t=i.element.classList;for(const r of this.st)r in e||(t.remove(r),this.st.delete(r));for(const r in e){const n=!!e[r];n===this.st.has(r)||this.nt?.has(r)||(n?(t.add(r),this.st.add(r)):(t.remove(r),this.st.delete(r)))}return At}}),Aw=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 os=class extends Ue{constructor(){super(...arguments),this.max=1}render(){const e=!at(this.value);return Q`<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 Q`<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=>Q`<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 Q`<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>`}};os.styles=[Me,Aw];w([D({type:Number,reflect:!0})],os.prototype,"max",void 0);w([D({type:Number})],os.prototype,"value",void 0);os=w([Re("mdui-circular-progress")],os);const Nw=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 Tr=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 Q`<div ${$e(this.surfaceRef)} class="surface ${lt({hover:this.hover,focused:this.focused,dragged:this.dragged})}"></div>`}};Tr.styles=[Me,Nw];w([D({type:Boolean,reflect:!0,converter:me,attribute:"no-ripple"})],Tr.prototype,"noRipple",void 0);w([Oe()],Tr.prototype,"hover",void 0);w([Oe()],Tr.prototype,"focused",void 0);w([Oe()],Tr.prototype,"dragged",void 0);Tr=w([Re("mdui-ripple")],Tr);const _i=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=>{qr(this.rippleTarget)&&(this.rippleIndex=n.index(a.target))};(qr(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(!qr(r))return r;const n=this.getRippleIndex();return n!==void 0?r[n]:r[0]}getRippleTarget(){const r=this.rippleTarget;if(!qr(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},Lw=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(_i(si(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(){return this.isButton()?this.renderRoot?.querySelector("._button"):this.focusDisabled?this:this.renderRoot?.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?Q`<mdui-circular-progress part="loading"></mdui-circular-progress>`:He}renderButton({id:e,className:t,part:r,content:n=Q`<slot></slot>`}){return Q`<button id="${De(e)}" class="${Ti(["_button",t])}" part="${De(r)}" ?disabled="${this.rippleDisabled||this.focusDisabled}">${n}</button>`}isButton(){return!this.href}}ot.styles=[Me,Lw];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 Dw=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(
440
+ */const bt=Ln(class extends Hs{constructor(i){if(super(i),i.type!==Mi.ATTRIBUTE||i.name!=="class"||i.strings?.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]){if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in e)e[r]&&!this.nt?.has(r)&&this.st.add(r);return this.render(e)}const t=i.element.classList;for(const r of this.st)r in e||(t.remove(r),this.st.delete(r));for(const r in e){const n=!!e[r];n===this.st.has(r)||this.nt?.has(r)||(n?(t.add(r),this.st.add(r)):(t.remove(r),this.st.delete(r)))}return Vt}}),_1=$e`: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 Ns=class extends Ke{constructor(){super(...arguments),this.max=1}render(){const e=!gt(this.value);return Z`<div class="progress ${bt({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 Z`<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=c=>Z`<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="${c}"></circle></svg>`;return Z`<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>`}};Ns.styles=[qe,_1];w([L({type:Number,reflect:!0})],Ns.prototype,"max",void 0);w([L({type:Number})],Ns.prototype,"value",void 0);Ns=w([Ae("mdui-circular-progress")],Ns);const x1=$e`: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 Wr=class extends Ke{constructor(){super(...arguments),this.noRipple=!1,this.hover=!1,this.focused=!1,this.dragged=!1,this.surfaceRef=Me()}startPress(e){if(this.noRipple)return;const t=oe(this.surfaceRef.value),r=t.innerHeight(),n=t.innerWidth();let s,o;if(!e)s=n/2,o=r/2;else{const u=typeof TouchEvent<"u"&&e instanceof TouchEvent&&e.touches.length?e.touches[0]:e,p=t.offset();if(u.pageX<p.left||u.pageX>p.left+n||u.pageY<p.top||u.pageY>p.top+r)return;s=u.pageX-p.left,o=u.pageY-p.top}const a=Math.max(Math.pow(Math.pow(r,2)+Math.pow(n,2),.5),48),c=`${-s+n/2}px`,l=`${-o+r/2}px`,d=`translate3d(${c}, ${l}, 0) scale(1)`;oe('<div class="wave"></div>').css({width:a,height:a,marginTop:-a/2,marginLeft:-a/2,left:s,top:o}).each((u,p)=>{p.style.setProperty("--mdui-comp-ripple-transition-x",c),p.style.setProperty("--mdui-comp-ripple-transition-y",l)}).prependTo(this.surfaceRef.value).each((u,p)=>p.clientLeft).css("transform",d).on("animationend",function(u){u.animationName==="mdui-comp-ripple-radius-in"&&oe(this).data("filled",!0)})}endPress(){const e=oe(this.surfaceRef.value).children().filter((r,n)=>!oe(n).data("removing")).data("removing",!0),t=r=>{r.addClass("out").each((n,s)=>s.clientLeft).on("animationend",function(){oe(this).remove()})};e.filter((r,n)=>!oe(n).data("filled")).on("animationend",function(r){r.animationName==="mdui-comp-ripple-radius-in"&&t(oe(this))}),t(e.filter((r,n)=>!!oe(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 Z`<div ${De(this.surfaceRef)} class="surface ${bt({hover:this.hover,focused:this.focused,dragged:this.dragged})}"></div>`}};Wr.styles=[qe,x1];w([L({type:Boolean,reflect:!0,converter:we,attribute:"no-ripple"})],Wr.prototype,"noRipple",void 0);w([Be()],Wr.prototype,"hover",void 0);w([Be()],Wr.prototype,"focused",void 0);w([Be()],Wr.prototype,"dragged",void 0);Wr=w([Ae("mdui-ripple")],Wr);const Di=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=oe(this.rippleTarget),s=a=>{un(this.rippleTarget)&&(this.rippleIndex=n.index(a.target))};(un(this.rippleTarget)?this.rippleTarget:[this.rippleTarget]).forEach(a=>{a.addEventListener("pointerdown",c=>{s(c),this.startPress(c)}),a.addEventListener("pointerenter",c=>{s(c),this.startHover(c)}),a.addEventListener("pointerleave",c=>{s(c),this.endHover(c)}),a.addEventListener("focus",c=>{s(c),this.startFocus()}),a.addEventListener("blur",c=>{s(c),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(!un(r))return r;const n=this.getRippleIndex();return n!==void 0?r[n]:r[0]}getRippleTarget(){const r=this.rippleTarget;if(!un(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)},c=()=>{o&&(clearTimeout(o),o=0),n.removeEventListener("touchmove",c)};n.addEventListener("touchmove",c),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([L({type:Boolean,reflect:!0,converter:we,attribute:"no-ripple"})],e.prototype,"noRipple",void 0),e},E1=$e`.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 pt extends On(Di(bi(Ke))){constructor(){super(...arguments),this.disabled=!1,this.loading=!1,this.name="",this.value="",this.type="button",this.formNoValidate=!1,this.formController=new lr(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(){return this.isButton()?this.renderRoot?.querySelector("._button"):this.focusDisabled?this:this.renderRoot?.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?Z`<mdui-circular-progress part="loading"></mdui-circular-progress>`:Qe}renderButton({id:e,className:t,part:r,content:n=Z`<slot></slot>`}){return Z`<button id="${je(e)}" class="${Bi(["_button",t])}" part="${je(r)}" ?disabled="${this.rippleDisabled||this.focusDisabled}">${n}</button>`}isButton(){return!this.href}}pt.styles=[qe,E1];w([L({type:Boolean,reflect:!0,converter:we})],pt.prototype,"disabled",void 0);w([L({type:Boolean,reflect:!0,converter:we})],pt.prototype,"loading",void 0);w([L({reflect:!0})],pt.prototype,"name",void 0);w([L({reflect:!0})],pt.prototype,"value",void 0);w([L({reflect:!0})],pt.prototype,"type",void 0);w([L({reflect:!0})],pt.prototype,"form",void 0);w([L({reflect:!0,attribute:"formaction"})],pt.prototype,"formAction",void 0);w([L({reflect:!0,attribute:"formenctype"})],pt.prototype,"formEnctype",void 0);w([L({reflect:!0,attribute:"formmethod"})],pt.prototype,"formMethod",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"formnovalidate"})],pt.prototype,"formNoValidate",void 0);w([L({reflect:!0,attribute:"formtarget"})],pt.prototype,"formTarget",void 0);const S1=$e`: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(
416
441
  --mdui-color-on-secondary-container
417
- )}: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 Q`<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?Q`<span part="button" class="button _a">${this.renderInner()}</span>`:this.renderAnchor({className:"button",part:"button",content:this.renderInner()})}`}renderIcon(){return this.loading?this.renderLoading():Q`<slot name="icon" part="icon" class="icon">${this.icon?Q`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot>`}renderLabel(){return Q`<slot part="label" class="label"></slot>`}renderEndIcon(){return Q`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?Q`<mdui-icon name="${this.endIcon}"></mdui-icon>`:He}</slot>`}renderInner(){return[this.renderIcon(),this.renderLabel(),this.renderEndIcon()]}};Ui.styles=[ot.styles,Dw];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 Ow=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(
442
+ )}: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 ir=class extends pt{constructor(){super(...arguments),this.variant="filled",this.fullWidth=!1,this.rippleRef=Me()}get rippleElement(){return this.rippleRef.value}render(){return Z`<mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:"button",part:"button",content:this.renderInner()}):this.disabled||this.loading?Z`<span part="button" class="button _a">${this.renderInner()}</span>`:this.renderAnchor({className:"button",part:"button",content:this.renderInner()})}`}renderIcon(){return this.loading?this.renderLoading():Z`<slot name="icon" part="icon" class="icon">${this.icon?Z`<mdui-icon name="${this.icon}"></mdui-icon>`:Qe}</slot>`}renderLabel(){return Z`<slot part="label" class="label"></slot>`}renderEndIcon(){return Z`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?Z`<mdui-icon name="${this.endIcon}"></mdui-icon>`:Qe}</slot>`}renderInner(){return[this.renderIcon(),this.renderLabel(),this.renderEndIcon()]}};ir.styles=[pt.styles,S1];w([L({reflect:!0})],ir.prototype,"variant",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"full-width"})],ir.prototype,"fullWidth",void 0);w([L({reflect:!0})],ir.prototype,"icon",void 0);w([L({reflect:!0,attribute:"end-icon"})],ir.prototype,"endIcon",void 0);ir=w([Ae("mdui-button")],ir);const k1=$e`: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(
418
443
  --mdui-color-on-secondary-container
419
- )}: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 Q`<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?Q`<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]")?Q`<slot></slot>`:this.icon?Q`<mdui-icon part="icon" class="icon" name="${this.icon}"></mdui-icon>`:He,t=()=>this.hasSlotController.test("selected-icon")||this.selectedIcon?Q`<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,Ow];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 Mw=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(_i(si(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 Q`<mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.href&&!this.disabled?this.renderAnchor({className:"link",content:Q`<slot></slot>`}):Q`<slot></slot>`}`}};Zr.styles=[Me,Mw];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);/**
444
+ )}: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 rr=class extends pt{constructor(){super(...arguments),this.variant="standard",this.selectable=!1,this.selected=!1,this.rippleRef=Me(),this.hasSlotController=new $t(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 Z`<mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:"button",part:"button",content:this.renderIcon()}):this.disabled||this.loading?Z`<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]")?Z`<slot></slot>`:this.icon?Z`<mdui-icon part="icon" class="icon" name="${this.icon}"></mdui-icon>`:Qe,t=()=>this.hasSlotController.test("selected-icon")||this.selectedIcon?Z`<slot name="selected-icon" part="selected-icon" class="selected-icon"><mdui-icon name="${this.selectedIcon}"></mdui-icon></slot>`:e();return this.selected?t():e()}};rr.styles=[pt.styles,k1];w([L({reflect:!0})],rr.prototype,"variant",void 0);w([L({reflect:!0})],rr.prototype,"icon",void 0);w([L({reflect:!0,attribute:"selected-icon"})],rr.prototype,"selectedIcon",void 0);w([L({type:Boolean,reflect:!0,converter:we})],rr.prototype,"selectable",void 0);w([L({type:Boolean,reflect:!0,converter:we})],rr.prototype,"selected",void 0);w([Re("selected",!0)],rr.prototype,"onSelectedChange",null);rr=w([Ae("mdui-button-icon")],rr);const R1=$e`: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 En=class extends On(Di(bi(Ke))){constructor(){super(...arguments),this.variant="elevated",this.clickable=!1,this.disabled=!1,this.rippleRef=Me()}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 Z`<mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.href&&!this.disabled?this.renderAnchor({className:"link",content:Z`<slot></slot>`}):Z`<slot></slot>`}`}};En.styles=[qe,R1];w([L({reflect:!0})],En.prototype,"variant",void 0);w([L({type:Boolean,reflect:!0,converter:we})],En.prototype,"clickable",void 0);w([L({type:Boolean,reflect:!0,converter:we})],En.prototype,"disabled",void 0);En=w([Ae("mdui-card")],En);/**
420
445
  * @license
421
446
  * Copyright 2020 Google LLC
422
447
  * SPDX-License-Identifier: BSD-3-Clause
423
- */const en=un(class extends bs{constructor(i){if(super(i),i.type!==ki.PROPERTY&&i.type!==ki.ATTRIBUTE&&i.type!==ki.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Ap(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===ki.PROPERTY){if(e===t[r])return At}else if(i.type===ki.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(r))return At}else if(i.type===ki.ATTRIBUTE&&t.getAttribute(r)===e+"")return At;return gw(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||zr,g=(dt(d)?d:d?.fromAttribute??zr.fromAttribute)(a,l.type);this[i]!==g&&(this[t]=g)}n.call(this,s,o,a)}}}const pi=Ie`:host{display:inline-block;width:1em;height:1em;line-height:1;font-size:1.5rem}`,mi=i=>Q`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="currentColor">${Cp(i)}</svg>`;let jl=class extends ct{render(){return mi('<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"/>')}};jl.styles=pi;jl=w([Re("mdui-icon-check-box-outline-blank")],jl);let Bl=class extends ct{render(){return mi('<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"/>')}};Bl.styles=pi;Bl=w([Re("mdui-icon-check-box")],Bl);let Fl=class extends ct{render(){return mi('<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"/>')}};Fl.styles=pi;Fl=w([Re("mdui-icon-indeterminate-check-box")],Fl);const Pw=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 gt=class extends _i(si(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(){await this.updateComplete;const e=this.formController.getForm();e&&ht.get(e)?.has(this)?(this.invalid=!1,ht.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 Q`<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?Q`<mdui-icon name="${this.uncheckedIcon}" class="i"></mdui-icon>`:Q`<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?Q`<mdui-icon name="${this.checkedIcon}" class="i"></mdui-icon>`:Q`<mdui-icon-check-box class="i"></mdui-icon-check-box>`}</slot><slot name="indeterminate-icon" part="indeterminate-icon" class="icon indeterminate-icon">${this.indeterminateIcon?Q`<mdui-icon name="${this.indeterminateIcon}" class="i"></mdui-icon>`:Q`<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")}};gt.styles=[Me,Pw];w([D({type:Boolean,reflect:!0,converter:me})],gt.prototype,"disabled",void 0);w([D({type:Boolean,reflect:!0,converter:me})],gt.prototype,"checked",void 0);w([ur("checked")],gt.prototype,"defaultChecked",void 0);w([D({type:Boolean,reflect:!0,converter:me})],gt.prototype,"indeterminate",void 0);w([D({type:Boolean,reflect:!0,converter:me})],gt.prototype,"required",void 0);w([D({reflect:!0})],gt.prototype,"form",void 0);w([D({reflect:!0})],gt.prototype,"name",void 0);w([D({reflect:!0})],gt.prototype,"value",void 0);w([D({reflect:!0,attribute:"unchecked-icon"})],gt.prototype,"uncheckedIcon",void 0);w([D({reflect:!0,attribute:"checked-icon"})],gt.prototype,"checkedIcon",void 0);w([D({reflect:!0,attribute:"indeterminate-icon"})],gt.prototype,"indeterminateIcon",void 0);w([Oe()],gt.prototype,"invalid",void 0);w([Ee("disabled",!0),Ee("indeterminate",!0),Ee("required",!0)],gt.prototype,"onDisabledChange",null);w([Ee("checked",!0)],gt.prototype,"onCheckedChange",null);gt=w([Re("mdui-checkbox")],gt);let ql=class extends ct{render(){return mi('<path d="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>')}};ql.styles=pi;ql=w([Re("mdui-icon-check")],ql);let Ul=class extends ct{render(){return mi('<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"/>')}};Ul.styles=pi;Ul=w([Re("mdui-icon-clear")],Ul);const jw=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(
448
+ */const Sn=Ln(class extends Hs{constructor(i){if(super(i),i.type!==Mi.PROPERTY&&i.type!==Mi.ATTRIBUTE&&i.type!==Mi.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!pm(i))throw Error("`live` bindings can only contain a single expression")}render(i){return i}update(i,[e]){if(e===Vt||e===it)return e;const t=i.element,r=i.name;if(i.type===Mi.PROPERTY){if(e===t[r])return Vt}else if(i.type===Mi.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(r))return Vt}else if(i.type===Mi.ATTRIBUTE&&t.getAttribute(r)===e+"")return Vt;return o1(i),e}});function Ir(i="value"){return(e,t)=>{const r=e.constructor,n=r.prototype.attributeChangedCallback;r.prototype.attributeChangedCallback=function(s,o,a){const c=r.getPropertyOptions(i),l=wt(c.attribute)?c.attribute:i;if(s===l){const d=c.converter||pn,p=(vt(d)?d:d?.fromAttribute??pn.fromAttribute)(a,c.type);this[i]!==p&&(this[t]=p)}n.call(this,s,o,a)}}}const ki=$e`:host{display:inline-block;width:1em;height:1em;line-height:1;font-size:1.5rem}`,Ri=i=>Z`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="currentColor">${fm(i)}</svg>`;let hc=class extends yt{render(){return Ri('<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"/>')}};hc.styles=ki;hc=w([Ae("mdui-icon-check-box-outline-blank")],hc);let fc=class extends yt{render(){return Ri('<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"/>')}};fc.styles=ki;fc=w([Ae("mdui-icon-check-box")],fc);let pc=class extends yt{render(){return Ri('<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"/>')}};pc.styles=ki;pc=w([Ae("mdui-icon-indeterminate-check-box")],pc);const I1=$e`: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 Tt=class extends Di(bi(Ke)){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=Me(),this.rippleRef=Me(),this.formController=new lr(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(){await this.updateComplete;const e=this.formController.getForm();e&&xt.get(e)?.has(this)?(this.invalid=!1,xt.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 Z`<label class="${bt({invalid:this.invalid})}"><input ${De(this.inputRef)} type="checkbox" name="${je(this.name)}" value="${je(this.value)}" .indeterminate="${Sn(this.indeterminate)}" .disabled="${this.disabled}" .checked="${Sn(this.checked)}" .required="${this.required}" @change="${this.onChange}"> <i part="control"><mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><slot name="unchecked-icon" part="unchecked-icon" class="icon unchecked-icon">${this.uncheckedIcon?Z`<mdui-icon name="${this.uncheckedIcon}" class="i"></mdui-icon>`:Z`<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?Z`<mdui-icon name="${this.checkedIcon}" class="i"></mdui-icon>`:Z`<mdui-icon-check-box class="i"></mdui-icon-check-box>`}</slot><slot name="indeterminate-icon" part="indeterminate-icon" class="icon indeterminate-icon">${this.indeterminateIcon?Z`<mdui-icon name="${this.indeterminateIcon}" class="i"></mdui-icon>`:Z`<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")}};Tt.styles=[qe,I1];w([L({type:Boolean,reflect:!0,converter:we})],Tt.prototype,"disabled",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Tt.prototype,"checked",void 0);w([Ir("checked")],Tt.prototype,"defaultChecked",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Tt.prototype,"indeterminate",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Tt.prototype,"required",void 0);w([L({reflect:!0})],Tt.prototype,"form",void 0);w([L({reflect:!0})],Tt.prototype,"name",void 0);w([L({reflect:!0})],Tt.prototype,"value",void 0);w([L({reflect:!0,attribute:"unchecked-icon"})],Tt.prototype,"uncheckedIcon",void 0);w([L({reflect:!0,attribute:"checked-icon"})],Tt.prototype,"checkedIcon",void 0);w([L({reflect:!0,attribute:"indeterminate-icon"})],Tt.prototype,"indeterminateIcon",void 0);w([Be()],Tt.prototype,"invalid",void 0);w([Re("disabled",!0),Re("indeterminate",!0),Re("required",!0)],Tt.prototype,"onDisabledChange",null);w([Re("checked",!0)],Tt.prototype,"onCheckedChange",null);Tt=w([Ae("mdui-checkbox")],Tt);let mc=class extends yt{render(){return Ri('<path d="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>')}};mc.styles=ki;mc=w([Ae("mdui-icon-check")],mc);let gc=class extends yt{render(){return Ri('<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"/>')}};gc.styles=ki;gc=w([Ae("mdui-icon-clear")],gc);const T1=$e`: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(
424
449
  --mdui-color-on-secondary-container
425
- )}: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 Zt=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=Ti({button:!0,"has-icon":this.loading||!this.selected&&e||this.selected&&r,"has-end-icon":t});return Q`<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?Q`<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?Q`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:He,t=()=>this.selectedIcon?Q`<mdui-icon name="${this.selectedIcon}" class="i"></mdui-icon>`:this.variant==="assist"||this.variant==="filter"?Q`<mdui-icon-check class="i"></mdui-icon-check>`:e();return this.selected?Q`<slot name="selected-icon" part="selected-icon" class="selected-icon">${t()}</slot>`:Q`<slot name="icon" part="icon" class="icon">${e()}</slot>`}renderLabel(){return Q`<slot part="label" class="label"></slot>`}renderEndIcon(){return Q`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?Q`<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`:He}</slot>`}renderDeleteIcon(){return this.deletable?Q`<slot name="delete-icon" part="delete-icon" class="delete-icon" @click="${this.onDelete}">${this.deleteIcon?Q`<mdui-icon name="${this.deleteIcon}" class="i"></mdui-icon>`:Q`<mdui-icon-clear class="i"></mdui-icon-clear>`}</slot>`:He}renderInner(){return[this.renderIcon(),this.renderLabel(),this.renderEndIcon(),this.renderDeleteIcon()]}};Zt.styles=[ot.styles,jw];w([D({reflect:!0})],Zt.prototype,"variant",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Zt.prototype,"elevated",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Zt.prototype,"selectable",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Zt.prototype,"selected",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Zt.prototype,"deletable",void 0);w([D({reflect:!0})],Zt.prototype,"icon",void 0);w([D({reflect:!0,attribute:"selected-icon"})],Zt.prototype,"selectedIcon",void 0);w([D({reflect:!0,attribute:"end-icon"})],Zt.prototype,"endIcon",void 0);w([D({reflect:!0,attribute:"delete-icon"})],Zt.prototype,"deleteIcon",void 0);w([Ee("selected",!0)],Zt.prototype,"onSelectedChange",null);Zt=w([Re("mdui-chip")],Zt);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])},Bw=Ie`:host{display:block}`;let $i=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(){await this.definedController.whenDefined();const e=this.accordion?this.items.find(t=>this.activeKeys.includes(t.key))?.value:this.items.filter(t=>this.activeKeys.includes(t.key)).map(t=>t.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 Q`<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})}};$i.styles=[Me,Bw];w([D({type:Boolean,reflect:!0,converter:me})],$i.prototype,"accordion",void 0);w([D()],$i.prototype,"value",void 0);w([D({type:Boolean,reflect:!0,converter:me})],$i.prototype,"disabled",void 0);w([Oe()],$i.prototype,"activeKeys",void 0);w([ni({selector:"mdui-collapse-item",flatten:!0})],$i.prototype,"items",void 0);w([Ee("activeKeys",!0)],$i.prototype,"onActiveKeysChange",null);w([Ee("value")],$i.prototype,"onValueChange",null);$i=w([Re("mdui-collapse")],$i);const Fw=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 Ci=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 Q`<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)}};Ci.styles=[Me,Fw];w([D({reflect:!0})],Ci.prototype,"value",void 0);w([D({reflect:!0})],Ci.prototype,"header",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Ci.prototype,"disabled",void 0);w([D()],Ci.prototype,"trigger",void 0);w([Oe()],Ci.prototype,"active",void 0);w([Oe()],Ci.prototype,"state",void 0);w([Ee("active")],Ci.prototype,"onActiveChange",null);Ci=w([Re("mdui-collapse-item")],Ci);/**
450
+ )}: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 ui=class extends pt{constructor(){super(),this.variant="assist",this.elevated=!1,this.selectable=!1,this.selected=!1,this.deletable=!1,this.rippleRef=Me(),this.hasSlotController=new $t(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=Bi({button:!0,"has-icon":this.loading||!this.selected&&e||this.selected&&r,"has-end-icon":t});return Z`<mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:n,part:"button",content:this.renderInner()}):this.disabled||this.loading?Z`<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?Z`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:Qe,t=()=>this.selectedIcon?Z`<mdui-icon name="${this.selectedIcon}" class="i"></mdui-icon>`:this.variant==="assist"||this.variant==="filter"?Z`<mdui-icon-check class="i"></mdui-icon-check>`:e();return this.selected?Z`<slot name="selected-icon" part="selected-icon" class="selected-icon">${t()}</slot>`:Z`<slot name="icon" part="icon" class="icon">${e()}</slot>`}renderLabel(){return Z`<slot part="label" class="label"></slot>`}renderEndIcon(){return Z`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?Z`<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`:Qe}</slot>`}renderDeleteIcon(){return this.deletable?Z`<slot name="delete-icon" part="delete-icon" class="delete-icon" @click="${this.onDelete}">${this.deleteIcon?Z`<mdui-icon name="${this.deleteIcon}" class="i"></mdui-icon>`:Z`<mdui-icon-clear class="i"></mdui-icon-clear>`}</slot>`:Qe}renderInner(){return[this.renderIcon(),this.renderLabel(),this.renderEndIcon(),this.renderDeleteIcon()]}};ui.styles=[pt.styles,T1];w([L({reflect:!0})],ui.prototype,"variant",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ui.prototype,"elevated",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ui.prototype,"selectable",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ui.prototype,"selected",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ui.prototype,"deletable",void 0);w([L({reflect:!0})],ui.prototype,"icon",void 0);w([L({reflect:!0,attribute:"selected-icon"})],ui.prototype,"selectedIcon",void 0);w([L({reflect:!0,attribute:"end-icon"})],ui.prototype,"endIcon",void 0);w([L({reflect:!0,attribute:"delete-icon"})],ui.prototype,"deleteIcon",void 0);w([Re("selected",!0)],ui.prototype,"onSelectedChange",null);ui=w([Ae("mdui-chip")],ui);const kn=(i,e)=>{if(i.length!==e.length)return!1;const t=[...i].sort(),r=[...e].sort();return t.every((n,s)=>n===r[s])},C1=$e`:host{display:block}`;let qi=class extends Ke{constructor(){super(...arguments),this.accordion=!1,this.disabled=!1,this.activeKeys=[],this.isInitial=!0,this.definedController=new At(this,{relatedElements:["mdui-collapse-item"]})}async onActiveKeysChange(){await this.definedController.whenDefined();const e=this.accordion?this.items.find(t=>this.activeKeys.includes(t.key))?.value:this.items.filter(t=>this.activeKeys.includes(t.key)).map(t=>t.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 Z`<slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot>`}setActiveKeys(e){kn(this.activeKeys,e)||(this.activeKeys=e)}setValue(e){this.accordion||gt(this.value)||gt(e)?this.value=e:kn(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=>tr(s)&&oe(s).is(r.trigger)))&&n.find(s=>tr(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})}};qi.styles=[qe,C1];w([L({type:Boolean,reflect:!0,converter:we})],qi.prototype,"accordion",void 0);w([L()],qi.prototype,"value",void 0);w([L({type:Boolean,reflect:!0,converter:we})],qi.prototype,"disabled",void 0);w([Be()],qi.prototype,"activeKeys",void 0);w([gi({selector:"mdui-collapse-item",flatten:!0})],qi.prototype,"items",void 0);w([Re("activeKeys",!0)],qi.prototype,"onActiveKeysChange",null);w([Re("value")],qi.prototype,"onValueChange",null);qi=w([Ae("mdui-collapse")],qi);const $1=$e`: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 Ui=class extends Ke{constructor(){super(...arguments),this.disabled=!1,this.active=!1,this.state="closed",this.isInitial=!0,this.key=Sr(),this.bodyRef=Me()}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 Z`<slot name="header" part="header" class="header">${this.header}</slot><slot part="body" class="body ${bt({opened:this.state==="opened",active:this.active})}" ${De(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"&&(oe(this.bodyRef.value).height(e),this.bodyRef.value.clientLeft),oe(this.bodyRef.value).height(this.state==="opened"?"auto":this.state==="open"?e:0)}};Ui.styles=[qe,$1];w([L({reflect:!0})],Ui.prototype,"value",void 0);w([L({reflect:!0})],Ui.prototype,"header",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ui.prototype,"disabled",void 0);w([L()],Ui.prototype,"trigger",void 0);w([Be()],Ui.prototype,"active",void 0);w([Be()],Ui.prototype,"state",void 0);w([Re("active")],Ui.prototype,"onActiveChange",null);Ui=w([Ae("mdui-collapse-item")],Ui);/**
426
451
  * @license
427
452
  * Copyright 2021 Google LLC
428
453
  * SPDX-License-Identifier: BSD-3-Clause
429
- */function Ye(i,e,t){return i?e(i):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.");vo(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 Yh(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 qw(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=>Yh(s))??null,n=e.reverse().find(s=>Yh(s))??null;return{start:r,end:n}}let Pn=[];class Mp{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}=qw(this.element),r=this.tabDirection==="forward"?e:t;typeof 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()},bi=(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 bl;const Uw=i=>{if(at(document))return 0;if(bl===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(),bl=r-n}return bl},Vw=i=>i.scrollHeight>i.clientHeight,Xn=new WeakMap,Pp="mdui-lock-screen",Vl=(i,e)=>{const t=zt();e??=t.documentElement,Xn.has(e)||Xn.set(e,new Set),Xn.get(e).add(i);const n=se(e);Vw(e)&&n.css("width",`calc(100% - ${Uw()}px)`),n.addClass(Pp)},Yn=(i,e)=>{const t=zt();e??=t.documentElement;const r=Xn.get(e);r&&(r.delete(i),r.size===0&&(Xn.delete(e),se(e).removeClass(Pp).width("")))};/**
454
+ */function at(i,e,t){return i?e(i):t?.(i)}function st(i,e,t){return i?new Promise(r=>{if(t.duration===1/0)throw new Error("Promise-based animations must be finite.");Jo(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 Zt(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 Df(i){const e=Er(),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 A1(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=>Df(s))??null,n=e.reverse().find(s=>Df(s))??null;return{start:r,end:n}}let ds=[];class vm{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(){ds.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){ds=ds.filter(e=>e!==this.element),document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return ds[ds.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(":focus-within")){const{start:e,end:t}=A1(this.element),r=this.tabDirection==="forward"?e:t;typeof 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 ti=(i,e)=>{const t=`--mdui-motion-easing-${e}`;return oe(i).css(t).trim()},$i=(i,e)=>{const t=`--mdui-motion-duration-${e}`,r=oe(i).css(t).trim().toLowerCase();return r.endsWith("ms")?parseFloat(r):parseFloat(r)*1e3};let Kl;const N1=i=>{if(gt(document))return 0;if(Kl===void 0){const e=oe("<div>").css({width:"100%",height:"200px"}),t=oe("<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(),Kl=r-n}return Kl},D1=i=>i.scrollHeight>i.clientHeight,Es=new WeakMap,wm="mdui-lock-screen",bc=(i,e)=>{const t=ii();e??=t.documentElement,Es.has(e)||Es.set(e,new Set),Es.get(e).add(i);const n=oe(e);D1(e)&&n.css("width",`calc(100% - ${N1()}px)`),n.addClass(wm)},Ss=(i,e)=>{const t=ii();e??=t.documentElement;const r=Es.get(e);r&&(r.delete(i),r.size===0&&(Es.delete(e),oe(e).removeClass(wm).width("")))};/**
430
455
  * @license
431
456
  * Copyright 2021 Google LLC
432
457
  * SPDX-License-Identifier: BSD-3-Clause
433
- */const zw="lit-localize-status";/**
458
+ */const L1="lit-localize-status";/**
434
459
  * @license
435
460
  * Copyright 2021 Google LLC
436
461
  * SPDX-License-Identifier: BSD-3-Clause
437
- */const Hw=i=>typeof i!="string"&&"strTag"in i,Ww=(i,e,t)=>{let r=i[0];for(let n=1;n<i.length;n++)r+=e[n-1],r+=i[n];return r};/**
462
+ */const O1=i=>typeof i!="string"&&"strTag"in i,P1=(i,e,t)=>{let r=i[0];for(let n=1;n<i.length;n++)r+=e[n-1],r+=i[n];return r};/**
438
463
  * @license
439
464
  * Copyright 2021 Google LLC
440
465
  * SPDX-License-Identifier: BSD-3-Clause
441
- */const Gw=i=>Hw(i)?Ww(i.strings,i.values):i;let Kw=Gw;/**
466
+ */const M1=i=>O1(i)?P1(i.strings,i.values):i;let F1=M1;/**
442
467
  * @license
443
468
  * Copyright 2020 Google LLC
444
469
  * SPDX-License-Identifier: BSD-3-Clause
445
- */class Jw{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)}}/**
470
+ */class j1{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)}}/**
446
471
  * @license
447
472
  * Copyright 2014 Travis Webb
448
473
  * SPDX-License-Identifier: MIT
@@ -450,21 +475,21 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
450
475
  * @license
451
476
  * Copyright 2021 Google LLC
452
477
  * SPDX-License-Identifier: BSD-3-Clause
453
- */let Qw=new Jw;Qw.resolve();let Zh=!1;const Us=new Map,Xw=(i,e)=>{Zh||(Zh=!0,ar().addEventListener(zw,n=>{n.detail.status==="ready"&&Us.forEach(s=>{s.forEach(o=>o())})}));const t=Us.get(i)||[];t.push(e),Us.set(i,t)},Vs=i=>{Us.delete(i)},Yw=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 ei=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(),Vl(this),await o(),requestAnimationFrame(()=>{const c=this.querySelector("[autofocus]");c?c.focus({preventScroll:!0}):this.panelRef.value.focus({preventScroll:!0})});const l=bi(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=bi(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",Yn(this);const c=this.originalTrigger;typeof c?.focus=="function"&&setTimeout(()=>c.focus()),this.emit("closed")}}disconnectedCallback(){super.disconnectedCallback(),Yn(this),Vs(this)}firstUpdated(e){super.firstUpdated(e),this.modalHelper=new Mp(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 Q`<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,()=>Q`<slot name="header" part="header" class="header">${Ye(r,()=>this.renderIcon())} ${Ye(n,()=>this.renderHeadline())}</slot>`)} ${Ye(a,()=>Q`<div ${$e(this.bodyRef)} part="body" class="body">${Ye(s,()=>this.renderDescription())}<slot></slot></div>`)} ${Ye(e,()=>Q`<slot name="action" part="action" class="action"></slot>`)}</div>`}onOverlayClick(){this.emit("overlay-click"),this.closeOnOverlayClick&&(this.open=!1)}renderIcon(){return Q`<slot name="icon" part="icon" class="icon">${this.icon?Q`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot>`}renderHeadline(){return Q`<slot name="headline" part="headline" class="headline">${this.headline}</slot>`}renderDescription(){return Q`<slot name="description" part="description" class="description">${this.description}</slot>`}};ei.styles=[Me,Yw];w([D({reflect:!0})],ei.prototype,"icon",void 0);w([D({reflect:!0})],ei.prototype,"headline",void 0);w([D({reflect:!0})],ei.prototype,"description",void 0);w([D({type:Boolean,reflect:!0,converter:me})],ei.prototype,"open",void 0);w([D({type:Boolean,reflect:!0,converter:me})],ei.prototype,"fullscreen",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"close-on-esc"})],ei.prototype,"closeOnEsc",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"close-on-overlay-click"})],ei.prototype,"closeOnOverlayClick",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"stacked-actions"})],ei.prototype,"stackedActions",void 0);w([ni({slot:"header",selector:"mdui-top-app-bar",flatten:!0})],ei.prototype,"topAppBarElements",void 0);w([Ee("open")],ei.prototype,"onOpenChange",null);ei=w([Re("mdui-dialog")],ei);const Zw=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 Q``}};rn.styles=[Me,Zw];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 Xc(){return typeof window<"u"}function jp(i){return Bp(i)?(i.nodeName||"").toLowerCase():"#document"}function vs(i){var e;return(i==null||(e=i.ownerDocument)==null?void 0:e.defaultView)||window}function e1(i){var e;return(e=(Bp(i)?i.ownerDocument:i.document)||window.document)==null?void 0:e.documentElement}function Bp(i){return Xc()?i instanceof Node||i instanceof vs(i).Node:!1}function t1(i){return Xc()?i instanceof HTMLElement||i instanceof vs(i).HTMLElement:!1}function ef(i){return!Xc()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof vs(i).ShadowRoot}const i1=new Set(["inline","contents"]);function Fp(i){const{overflow:e,overflowX:t,overflowY:r,display:n}=s1(i);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!i1.has(n)}const r1=new Set(["html","body","#document"]);function n1(i){return r1.has(jp(i))}function s1(i){return vs(i).getComputedStyle(i)}function o1(i){if(jp(i)==="html")return i;const e=i.assignedSlot||i.parentNode||ef(i)&&i.host||e1(i);return ef(e)?e.host:e}function qp(i){const e=o1(i);return n1(e)?i.ownerDocument?i.ownerDocument.body:i.body:t1(e)&&Fp(e)?e:qp(e)}function io(i,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const n=qp(i),s=n===((r=i.ownerDocument)==null?void 0:r.body),o=vs(n);if(s){const a=a1(o);return e.concat(o,o.visualViewport||[],Fp(n)?n:[],a&&t?io(a):[])}return e.concat(n,io(n,[],t))}function a1(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}const l1=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(){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 s=this.panelElements.find(a=>dt(a.focus));setTimeout(()=>{s?.focus()});const o=bi(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?o:0,easing:r}),Je(this.panelRef.value,[{opacity:0},{opacity:1,offset:.125},{opacity:1}],{duration:e?o:0,easing:t})]),e&&this.emit("opened")}else{if(!this.emit("close",{cancelable:!0}))return;!this.hasTrigger("focus")&&dt(this.triggerElement?.focus)&&(this.contains(document.activeElement)||this.contains(document.activeElement?.assignedSlot??null))&&this.triggerElement.focus();const o=bi(this,"short4");await qt(this.panelRef.value),await Promise.all([Je(this.panelRef.value,[{transform:`${this.getCssScaleName()}(1)`},{transform:`${this.getCssScaleName()}(0.45)`}],{duration:o,easing:n}),Je(this.panelRef.value,[{opacity:1},{opacity:1,offset:.875},{opacity:0}],{duration:o,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=io(this.triggerElement),this.overflowAncestors.forEach(e=>{e.addEventListener("scroll",this.onWindowScroll)}),this.observeResize=cr(this.triggerElement,()=>{this.updatePositioner()})})}disconnectedCallback(){!this.open&&this.panelRef.value&&(this.panelRef.value.hidden=!0),super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentClick),document.removeEventListener("keydown",this.onDocumentKeydown),this.overflowAncestors?.forEach(e=>{e.removeEventListener("scroll",this.onWindowScroll)}),this.observeResize?.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 Q`<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){if(!(this.disabled||!this.open)){if(e.key==="Escape"){this.open=!1;return}e.key==="Tab"&&(!this.hasTrigger("focus")&&dt(this.triggerElement?.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?.map(_=>_.offsetWidth)??[]),height: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,l1];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([ni({slot:"trigger",flatten:!0})],Lt.prototype,"triggerElements",void 0);w([ni({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 Up=(i=0)=>new Promise(e=>setTimeout(e,i)),c1=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(
478
+ */let B1=new j1;B1.resolve();let Lf=!1;const wo=new Map,q1=(i,e)=>{Lf||(Lf=!0,Er().addEventListener(L1,n=>{n.detail.status==="ready"&&wo.forEach(s=>{s.forEach(o=>o())})}));const t=wo.get(i)||[];t.push(e),wo.set(i,t)},_o=i=>{wo.delete(i)},U1=$e`: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 hi=class extends Ke{constructor(){super(...arguments),this.open=!1,this.fullscreen=!1,this.closeOnEsc=!1,this.closeOnOverlayClick=!1,this.stackedActions=!1,this.overlayRef=Me(),this.panelRef=Me(),this.bodyRef=Me(),this.hasSlotController=new $t(this,"header","icon","headline","description","action","[default]"),this.definedController=new At(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=ti(this,"linear"),n=ti(this,"emphasized-decelerate"),s=ti(this,"emphasized-accelerate"),o=()=>Promise.all([Zt(this.overlayRef.value),Zt(this.panelRef.value),...t.map(a=>Zt(a))]);if(this.open){if(e&&!this.emit("open",{cancelable:!0}))return;this.style.display="flex";const a=this.topAppBarElements??[];if(a.length){const l=a[0];l.scrollTarget||(l.scrollTarget=this.bodyRef.value),this.bodyRef.value.style.marginTop="0"}this.originalTrigger=document.activeElement,this.modalHelper.activate(),bc(this),await o(),requestAnimationFrame(()=>{const l=this.querySelector("[autofocus]");l?l.focus({preventScroll:!0}):this.panelRef.value.focus({preventScroll:!0})});const c=$i(this,"medium4");await Promise.all([st(this.overlayRef.value,[{opacity:0},{opacity:1,offset:.3},{opacity:1}],{duration:e?c:0,easing:r}),st(this.panelRef.value,[{transform:"translateY(-1.875rem) scaleY(0)"},{transform:"translateY(0) scaleY(1)"}],{duration:e?c:0,easing:n}),st(this.panelRef.value,[{opacity:0},{opacity:1,offset:.1},{opacity:1}],{duration:e?c:0,easing:r}),...t.map(l=>st(l,[{opacity:0},{opacity:0,offset:.2},{opacity:1,offset:.8},{opacity:1}],{duration:e?c:0,easing:r}))]),e&&this.emit("opened")}else{if(!this.emit("close",{cancelable:!0}))return;this.modalHelper.deactivate(),await o();const c=$i(this,"short4");await Promise.all([st(this.overlayRef.value,[{opacity:1},{opacity:0}],{duration:c,easing:r}),st(this.panelRef.value,[{transform:"translateY(0) scaleY(1)"},{transform:"translateY(-1.875rem) scaleY(0.6)"}],{duration:c,easing:s}),st(this.panelRef.value,[{opacity:1},{opacity:1,offset:.75},{opacity:0}],{duration:c,easing:r}),...t.map(d=>st(d,[{opacity:1},{opacity:0,offset:.75},{opacity:0}],{duration:c,easing:r}))]),this.style.display="none",Ss(this);const l=this.originalTrigger;typeof l?.focus=="function"&&setTimeout(()=>l.focus()),this.emit("closed")}}disconnectedCallback(){super.disconnectedCallback(),Ss(this),_o(this)}firstUpdated(e){super.firstUpdated(e),this.modalHelper=new vm(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 Z`<div ${De(this.overlayRef)} part="overlay" class="overlay" @click="${this.onOverlayClick}" tabindex="-1"></div><div ${De(this.panelRef)} part="panel" class="panel ${bt({"has-icon":r,"has-description":s,"has-default":t})}" tabindex="0">${at(o,()=>Z`<slot name="header" part="header" class="header">${at(r,()=>this.renderIcon())} ${at(n,()=>this.renderHeadline())}</slot>`)} ${at(a,()=>Z`<div ${De(this.bodyRef)} part="body" class="body">${at(s,()=>this.renderDescription())}<slot></slot></div>`)} ${at(e,()=>Z`<slot name="action" part="action" class="action"></slot>`)}</div>`}onOverlayClick(){this.emit("overlay-click"),this.closeOnOverlayClick&&(this.open=!1)}renderIcon(){return Z`<slot name="icon" part="icon" class="icon">${this.icon?Z`<mdui-icon name="${this.icon}"></mdui-icon>`:Qe}</slot>`}renderHeadline(){return Z`<slot name="headline" part="headline" class="headline">${this.headline}</slot>`}renderDescription(){return Z`<slot name="description" part="description" class="description">${this.description}</slot>`}};hi.styles=[qe,U1];w([L({reflect:!0})],hi.prototype,"icon",void 0);w([L({reflect:!0})],hi.prototype,"headline",void 0);w([L({reflect:!0})],hi.prototype,"description",void 0);w([L({type:Boolean,reflect:!0,converter:we})],hi.prototype,"open",void 0);w([L({type:Boolean,reflect:!0,converter:we})],hi.prototype,"fullscreen",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"close-on-esc"})],hi.prototype,"closeOnEsc",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"close-on-overlay-click"})],hi.prototype,"closeOnOverlayClick",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"stacked-actions"})],hi.prototype,"stackedActions",void 0);w([gi({slot:"header",selector:"mdui-top-app-bar",flatten:!0})],hi.prototype,"topAppBarElements",void 0);w([Re("open")],hi.prototype,"onOpenChange",null);hi=w([Ae("mdui-dialog")],hi);const V1=$e`: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 Ke{constructor(){super(...arguments),this.vertical=!1,this.inset=!1,this.middle=!1}render(){return Z``}};Rn.styles=[qe,V1];w([L({type:Boolean,reflect:!0,converter:we})],Rn.prototype,"vertical",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Rn.prototype,"inset",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Rn.prototype,"middle",void 0);Rn=w([Ae("mdui-divider")],Rn);function kd(){return typeof window<"u"}function _m(i){return xm(i)?(i.nodeName||"").toLowerCase():"#document"}function Ws(i){var e;return(i==null||(e=i.ownerDocument)==null?void 0:e.defaultView)||window}function z1(i){var e;return(e=(xm(i)?i.ownerDocument:i.document)||window.document)==null?void 0:e.documentElement}function xm(i){return kd()?i instanceof Node||i instanceof Ws(i).Node:!1}function H1(i){return kd()?i instanceof HTMLElement||i instanceof Ws(i).HTMLElement:!1}function Of(i){return!kd()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof Ws(i).ShadowRoot}const W1=new Set(["inline","contents"]);function Em(i){const{overflow:e,overflowX:t,overflowY:r,display:n}=X1(i);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!W1.has(n)}const G1=new Set(["html","body","#document"]);function K1(i){return G1.has(_m(i))}function X1(i){return Ws(i).getComputedStyle(i)}function J1(i){if(_m(i)==="html")return i;const e=i.assignedSlot||i.parentNode||Of(i)&&i.host||z1(i);return Of(e)?e.host:e}function Sm(i){const e=J1(i);return K1(e)?i.ownerDocument?i.ownerDocument.body:i.body:H1(e)&&Em(e)?e:Sm(e)}function Lo(i,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const n=Sm(i),s=n===((r=i.ownerDocument)==null?void 0:r.body),o=Ws(n);if(s){const a=Q1(o);return e.concat(o,o.visualViewport||[],Em(n)?n:[],a&&t?Lo(a):[])}return e.concat(n,Lo(n,[],t))}function Q1(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}const Y1=$e`:host{--z-index:2100;display:contents}.panel{display:block;position:fixed;z-index:var(--z-index)}`;let Ht=class extends Ke{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=Me(),this.definedController=new At(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(){const e=this.hasUpdated;if(!this.open&&!e)return;await this.definedController.whenDefined(),e||await this.updateComplete;const t=ti(this,"linear"),r=ti(this,"emphasized-decelerate"),n=ti(this,"emphasized-accelerate");if(this.open){if(e&&!this.emit("open",{cancelable:!0}))return;const s=this.panelElements.find(a=>vt(a.focus));setTimeout(()=>{s?.focus()});const o=$i(this,"medium4");await Zt(this.panelRef.value),this.panelRef.value.hidden=!1,this.updatePositioner(),await Promise.all([st(this.panelRef.value,[{transform:`${this.getCssScaleName()}(0.45)`},{transform:`${this.getCssScaleName()}(1)`}],{duration:e?o:0,easing:r}),st(this.panelRef.value,[{opacity:0},{opacity:1,offset:.125},{opacity:1}],{duration:e?o:0,easing:t})]),e&&this.emit("opened")}else{if(!this.emit("close",{cancelable:!0}))return;!this.hasTrigger("focus")&&vt(this.triggerElement?.focus)&&(this.contains(document.activeElement)||this.contains(document.activeElement?.assignedSlot??null))&&this.triggerElement.focus();const o=$i(this,"short4");await Zt(this.panelRef.value),await Promise.all([st(this.panelRef.value,[{transform:`${this.getCssScaleName()}(1)`},{transform:`${this.getCssScaleName()}(0.45)`}],{duration:o,easing:n}),st(this.panelRef.value,[{opacity:1},{opacity:1,offset:.875},{opacity:0}],{duration:o,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=Lo(this.triggerElement),this.overflowAncestors.forEach(e=>{e.addEventListener("scroll",this.onWindowScroll)}),this.observeResize=kr(this.triggerElement,()=>{this.updatePositioner()})})}disconnectedCallback(){!this.open&&this.panelRef.value&&(this.panelRef.value.hidden=!0),super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentClick),document.removeEventListener("keydown",this.onDocumentKeydown),this.overflowAncestors?.forEach(e=>{e.removeEventListener("scroll",this.onWindowScroll)}),this.observeResize?.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 Z`<slot name="trigger" part="trigger" class="trigger"></slot><slot ${De(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){if(!(this.disabled||!this.open)){if(e.key==="Escape"){this.open=!1;return}e.key==="Tab"&&(!this.hasTrigger("focus")&&vt(this.triggerElement?.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&&oe(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=oe(this.panelRef.value),t=oe(window),r=this.panelElements,n={width:Math.max(...r?.map(_=>_.offsetWidth)??[]),height: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 c,l,d,u,p=this.placement;if(p==="auto"){const _=t.width(),E=t.height();let x,k;E-o.top-o.height>n.height+a?x="bottom":o.top>n.height+a?x="top":_-o.left-o.width>n.width+a?x="right":o.left>n.width+a?x="left":x="bottom",["top","bottom"].includes(x)?_-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",p=k?[x,k].join("-"):x}const[g,v]=p.split("-");switch(this.animateDirection=["top","bottom"].includes(g)?"vertical":"horizontal",g){case"top":l="bottom",d=o.top-n.height;break;case"bottom":l="top",d=o.top+o.height;break;default:switch(l="center",v){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(g){case"left":c="right",u=o.left-n.width;break;case"right":c="left",u=o.left+o.width;break;default:switch(c="center",v){case"start":u=o.left;break;case"end":u=o.left+o.width-n.width;break;default:u=o.left+o.width/2-n.width/2;break}break}e.css({top:d,left:u,transformOrigin:[c,l].join(" ")})}};Ht.styles=[qe,Y1];w([L({type:Boolean,reflect:!0,converter:we})],Ht.prototype,"open",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ht.prototype,"disabled",void 0);w([L({reflect:!0})],Ht.prototype,"trigger",void 0);w([L({reflect:!0})],Ht.prototype,"placement",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"stay-open-on-click"})],Ht.prototype,"stayOpenOnClick",void 0);w([L({type:Number,reflect:!0,attribute:"open-delay"})],Ht.prototype,"openDelay",void 0);w([L({type:Number,reflect:!0,attribute:"close-delay"})],Ht.prototype,"closeDelay",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"open-on-pointer"})],Ht.prototype,"openOnPointer",void 0);w([gi({slot:"trigger",flatten:!0})],Ht.prototype,"triggerElements",void 0);w([gi({flatten:!0})],Ht.prototype,"panelElements",void 0);w([Re("placement",!0),Re("openOnPointer",!0)],Ht.prototype,"onPositionChange",null);w([Re("open")],Ht.prototype,"onOpenChange",null);Ht=w([Ae("mdui-dropdown")],Ht);const km=(i=0)=>new Promise(e=>setTimeout(e,i)),Z1=$e`: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(
454
479
  --mdui-color-on-primary-container
455
480
  )}: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(
456
481
  --mdui-color-on-secondary-container
457
482
  )}: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(
458
483
  --mdui-color-on-tertiary-container
459
- )}: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 Up(),this.style.transitionProperty="box-shadow, width, bottom, transform")}render(){const e=Ti({button:!0,"has-icon":this.icon||this.hasSlotController.test("icon")});return Q`<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?Q`<span part="button" class="_a ${e}">${this.renderInner()}</span>`:this.renderAnchor({className:e,part:"button",content:this.renderInner()})}`}renderLabel(){return Q`<slot part="label" class="label"></slot>`}renderIcon(){return this.loading?this.renderLoading():Q`<slot name="icon" part="icon" class="icon">${this.icon?Q`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot>`}renderInner(){return[this.renderIcon(),this.renderLabel()]}};rr.styles=[ot.styles,c1];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 d1=Ie`:host{position:relative;display:flex;flex:1 1 auto;overflow:hidden}:host([full-height]:not([full-height=false i])){height:100%}`;let ro=class extends Ue{constructor(){super(...arguments),this.fullHeight=!1}render(){return Q`<slot></slot>`}};ro.styles=[Me,d1];w([D({type:Boolean,reflect:!0,converter:me,attribute:"full-height"})],ro.prototype,"fullHeight",void 0);ro=w([Re("mdui-layout")],ro);const u1=Ie`:host{display:flex;z-index:1}`;let as=class extends dr{constructor(){super(...arguments),this.placement="top"}get layoutPlacement(){return this.placement}onPlacementChange(){this.layoutManager?.updateLayout(this)}render(){return Q`<slot></slot>`}};as.styles=[Me,u1];w([D({reflect:!0})],as.prototype,"placement",void 0);w([Ee("placement",!0)],as.prototype,"onPlacementChange",null);as=w([Re("mdui-layout-item")],as);const h1=Ie`:host{flex:1 0 auto;max-width:100%;overflow:auto}`;let zl=class extends Ue{connectedCallback(){super.connectedCallback();const e=this.parentElement;ms(e,"mdui-layout")&&(this.layoutManager=Dp(e),this.layoutManager.registerMain(this))}disconnectedCallback(){super.disconnectedCallback(),this.layoutManager&&this.layoutManager.unregisterMain()}render(){return Q`<slot></slot>`}};zl.styles=[Me,h1];zl=w([Re("mdui-layout-main")],zl);const f1=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 ls=class extends Ue{constructor(){super(...arguments),this.max=1}render(){if(!at(this.value)){const t=this.value;return Q`<div part="indicator" class="determinate" style="${wr({width:`${t/Math.max(this.max??t,t)*100}%`})}"></div>`}return Q`<div part="indicator" class="indeterminate"></div>`}};ls.styles=[Me,f1];w([D({type:Number,reflect:!0})],ls.prototype,"max",void 0);w([D({type:Number})],ls.prototype,"value",void 0);ls=w([Re("mdui-linear-progress")],ls);const p1=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(
484
+ )}: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 vr=class extends pt{constructor(){super(...arguments),this.variant="primary",this.size="normal",this.extended=!1,this.rippleRef=Me(),this.hasSlotController=new $t(this,"icon"),this.definedController=new At(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 km(),this.style.transitionProperty="box-shadow, width, bottom, transform")}render(){const e=Bi({button:!0,"has-icon":this.icon||this.hasSlotController.test("icon")});return Z`<mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:e,part:"button",content:this.renderInner()}):this.disabled||this.loading?Z`<span part="button" class="_a ${e}">${this.renderInner()}</span>`:this.renderAnchor({className:e,part:"button",content:this.renderInner()})}`}renderLabel(){return Z`<slot part="label" class="label"></slot>`}renderIcon(){return this.loading?this.renderLoading():Z`<slot name="icon" part="icon" class="icon">${this.icon?Z`<mdui-icon name="${this.icon}"></mdui-icon>`:Qe}</slot>`}renderInner(){return[this.renderIcon(),this.renderLabel()]}};vr.styles=[pt.styles,Z1];w([L({reflect:!0})],vr.prototype,"variant",void 0);w([L({reflect:!0})],vr.prototype,"size",void 0);w([L({reflect:!0})],vr.prototype,"icon",void 0);w([L({type:Boolean,reflect:!0,converter:we})],vr.prototype,"extended",void 0);w([Re("extended")],vr.prototype,"onExtendedChange",null);vr=w([Ae("mdui-fab")],vr);const e_=$e`: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 Ke{constructor(){super(...arguments),this.fullHeight=!1}render(){return Z`<slot></slot>`}};Oo.styles=[qe,e_];w([L({type:Boolean,reflect:!0,converter:we,attribute:"full-height"})],Oo.prototype,"fullHeight",void 0);Oo=w([Ae("mdui-layout")],Oo);const t_=$e`:host{display:flex;z-index:1}`;let Ds=class extends Rr{constructor(){super(...arguments),this.placement="top"}get layoutPlacement(){return this.placement}onPlacementChange(){this.layoutManager?.updateLayout(this)}render(){return Z`<slot></slot>`}};Ds.styles=[qe,t_];w([L({reflect:!0})],Ds.prototype,"placement",void 0);w([Re("placement",!0)],Ds.prototype,"onPlacementChange",null);Ds=w([Ae("mdui-layout-item")],Ds);const i_=$e`:host{flex:1 0 auto;max-width:100%;overflow:auto}`;let yc=class extends Ke{connectedCallback(){super.connectedCallback();const e=this.parentElement;Us(e,"mdui-layout")&&(this.layoutManager=bm(e),this.layoutManager.registerMain(this))}disconnectedCallback(){super.disconnectedCallback(),this.layoutManager&&this.layoutManager.unregisterMain()}render(){return Z`<slot></slot>`}};yc.styles=[qe,i_];yc=w([Ae("mdui-layout-main")],yc);const r_=$e`: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 Ls=class extends Ke{constructor(){super(...arguments),this.max=1}render(){if(!gt(this.value)){const t=this.value;return Z`<div part="indicator" class="determinate" style="${jr({width:`${t/Math.max(this.max??t,t)*100}%`})}"></div>`}return Z`<div part="indicator" class="indeterminate"></div>`}};Ls.styles=[qe,r_];w([L({type:Number,reflect:!0})],Ls.prototype,"max",void 0);w([L({type:Number})],Ls.prototype,"value",void 0);Ls=w([Ae("mdui-linear-progress")],Ls);const n_=$e`: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(
460
485
  --mdui-color-on-secondary-container
461
- )}: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(_i(si(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=>ms(a,"mdui-icon")||j0(a).startsWith("mdui-icon-"),o=Ti({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 Q`<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)}):Q`<div part="container" class="${o}" ${$e(this.itemRef)}>${this.renderInner()}</div>`}`}renderInner(){const e=this.hasSlotController.test("[default]");return Q`<slot name="custom"><slot name="icon" part="icon" class="icon">${this.icon?Q`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot><div part="body" class="body">${e?Q`<slot part="headline" class="headline"></slot>`:Q`<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?Q`<mdui-icon name="${this.endIcon}"></mdui-icon>`:He}</slot></slot>`}};$t.styles=[Me,p1];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([ni({slot:"icon",flatten:!0})],$t.prototype,"iconElements",void 0);w([ni({slot:"end-icon",flatten:!0})],$t.prototype,"endIconElements",void 0);$t=w([Re("mdui-list-item")],$t);const m1=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 Hl=class extends Ue{render(){return Q`<slot></slot>`}};Hl.styles=[Me,m1];Hl=w([Re("mdui-list-subheader")],Hl);const g1=Ie`:host{display:block;padding:.5rem 0}::slotted(mdui-divider[middle]){margin-left:1rem;margin-right:1.5rem}`;let Wl=class extends Ue{render(){return Q`<slot></slot>`}};Wl.styles=[Me,g1];Wl=w([Re("mdui-list")],Wl);let Gl=class extends ct{render(){return mi('<path d="m10 17 5-5-5-5v10z"/>')}};Gl.styles=pi;Gl=w([Re("mdui-icon-arrow-right")],Gl);const y1=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 yt=class extends hn(_i(si(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=bi(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=bi(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=Ti({container:!0,dense:this.dense,preset:!t,"has-icon":o,"has-end-text":a,"has-end-icon":s});return Q`<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}):Q`<div part="container" ${$e(this.containerRef)} class="${l}">${this.renderInner(n,o)}</div>`} ${Ye(e,()=>Q`<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 Q`<slot name="custom">${this.selected?Q`<slot name="selected-icon" part="selected-icon" class="selected-icon">${this.selectedIcon?Q`<mdui-icon name="${this.selectedIcon}" class="i"></mdui-icon>`:Q`<mdui-icon-check class="i"></mdui-icon-check>`}</slot>`:Q`<slot name="icon" part="icon" class="icon">${t?Q`<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?Q`<mdui-icon-arrow-right part="end-icon" class="end-icon arrow-right"></mdui-icon-arrow-right>`:Q`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?Q`<mdui-icon name="${this.endIcon}"></mdui-icon>`:He}</slot>`}</slot>`}};yt.styles=[Me,y1];w([D({reflect:!0})],yt.prototype,"value",void 0);w([D({type:Boolean,reflect:!0,converter:me})],yt.prototype,"disabled",void 0);w([D({reflect:!0})],yt.prototype,"icon",void 0);w([D({reflect:!0,attribute:"end-icon"})],yt.prototype,"endIcon",void 0);w([D({reflect:!0,attribute:"end-text"})],yt.prototype,"endText",void 0);w([D({reflect:!0,attribute:"selected-icon"})],yt.prototype,"selectedIcon",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"submenu-open"})],yt.prototype,"submenuOpen",void 0);w([D({type:Boolean,reflect:!0,converter:me})],yt.prototype,"selected",void 0);w([Oe()],yt.prototype,"dense",void 0);w([Oe()],yt.prototype,"selects",void 0);w([Oe()],yt.prototype,"submenuTrigger",void 0);w([Oe()],yt.prototype,"submenuOpenDelay",void 0);w([Oe()],yt.prototype,"submenuCloseDelay",void 0);w([Oe()],yt.prototype,"focusable",void 0);w([Ee("submenuOpen")],yt.prototype,"onOpenChange",null);yt=w([Re("mdui-menu-item")],yt);const b1=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 Q`<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?.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 Up()}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,b1];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([ni({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 v1=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 Ai=class extends hn(_i(si(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(){return this.href?this.renderRoot?.querySelector("._a"):this}get focusDisabled(){return this.disabled}render(){const e=Ti({"label-visibility-selected":this.labelVisibility==="selected","label-visibility-labeled":this.labelVisibility==="labeled","label-visibility-unlabeled":this.labelVisibility==="unlabeled",initial:this.isInitial}),t=Ti([{container:!0,"has-active-icon":this.activeIcon||this.hasSlotController.test("active-icon")},e]);return Q`<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()}):Q`<div part="container" class="${t}">${this.renderInner()}</div>`}`}renderInner(){return Q`<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?Q`<mdui-icon name="${this.activeIcon}"></mdui-icon>`:He}</slot><slot name="icon" part="icon" class="icon">${this.icon?Q`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot></div><slot part="label" class="label"></slot>`}};Ai.styles=[Me,v1];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([Oe()],Ai.prototype,"labelVisibility",void 0);w([Oe()],Ai.prototype,"isInitial",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Ai.prototype,"active",void 0);w([Oe()],Ai.prototype,"disabled",void 0);Ai=w([Re("mdui-navigation-bar-item")],Ai);const w1=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 di=class extends Jc(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?.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?.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 Q`<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()}};di.styles=[Me,w1];w([D({type:Boolean,reflect:!0,converter:me})],di.prototype,"hide",void 0);w([D({reflect:!0,attribute:"label-visibility"})],di.prototype,"labelVisibility",void 0);w([D({reflect:!0})],di.prototype,"value",void 0);w([D({reflect:!0,attribute:"scroll-behavior"})],di.prototype,"scrollBehavior",void 0);w([Oe()],di.prototype,"activeKey",void 0);w([ni({selector:"mdui-navigation-bar-item",flatten:!0})],di.prototype,"items",void 0);w([Ee("activeKey",!0)],di.prototype,"onActiveKeyChange",null);w([Ee("value")],di.prototype,"onValueChange",null);w([Ee("labelVisibility",!0)],di.prototype,"onLabelVisibilityChange",null);di=w([Re("mdui-navigation-bar")],di);const Kl=i=>{const e=ar(),t=zt(),r=e.getComputedStyle(t.documentElement),n=qi(i)?se(i).innerWidth():vo(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)}}},_1=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(){await this.definedController.whenDefined(),this.observeResize?.unobserve(),this.setObserveResize()}onPlacementChange(){this.isParentLayout&&this.layoutManager.updateLayout(this)}async onMobileChange(){!this.open||this.isParentLayout||this.contained||(await this.definedController.whenDefined(),this.isModal?(Vl(this,this.lockTarget),await this.getLockTargetAnimate(!1,0)):(Yn(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",jc(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||Vl(this,this.lockTarget)),await a(),requestAnimationFrame(()=>{const f=this.querySelector("[autofocus]");f?f.focus({preventScroll:!0}):e.focus({preventScroll:!0})});const c=bi(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=bi(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&&Yn(this,this.lockTarget);const f=this.originalTrigger;dt(f?.focus)&&setTimeout(()=>f.focus()),this.emit("closed")}}connectedCallback(){super.connectedCallback(),this.modalHelper=new Mp(this),this.definedController.whenDefined().then(()=>{this.setObserveResize()})}disconnectedCallback(){super.disconnectedCallback(),Yn(this,this.lockTarget),this.observeResize?.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 Q`${Ye(this.isModal,()=>Q`<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=Kl(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,_1];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 x1=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?.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?.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(){await this.definedController.whenDefined(),this.layoutManager?.updateLayout(this),this.items.forEach(e=>{e.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 Q`${Ye(e,()=>Q`<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,()=>Q`<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,x1];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([ni({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 E1=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 Ni=class extends hn(_i(si(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(){return this.href?this.renderRoot?.querySelector("._a"):this}get focusDisabled(){return this.disabled}render(){const e=this.hasSlotController.test("[default]"),t=Ti({container:!0,"has-label":e,"has-active-icon":this.activeIcon||this.hasSlotController.test("active-icon"),initial:this.isInitial});return Q`${this.href?this.renderAnchor({part:"container",className:t,content:this.renderInner(e)}):Q`<div part="container" class="${t}">${this.renderInner(e)}</div>`}<mdui-ripple .noRipple="${!this.active||this.noRipple}" ${$e(this.rippleRef)}></mdui-ripple>`}renderInner(e){return Q`<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?Q`<mdui-icon name="${this.activeIcon}"></mdui-icon>`:He}</slot><slot name="icon" part="icon" class="icon">${this.icon?Q`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot></div>${e?Q`<slot part="label" class="label"></slot>`:Ge}`}};Ni.styles=[Me,E1];w([D({reflect:!0})],Ni.prototype,"icon",void 0);w([D({reflect:!0,attribute:"active-icon"})],Ni.prototype,"activeIcon",void 0);w([D({reflect:!0})],Ni.prototype,"value",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Ni.prototype,"active",void 0);w([Oe()],Ni.prototype,"isInitial",void 0);w([Oe()],Ni.prototype,"placement",void 0);w([Oe()],Ni.prototype,"disabled",void 0);Ni=w([Re("mdui-navigation-rail-item")],Ni);let Jl=class extends ct{render(){return mi('<path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2z"/>')}};Jl.styles=pi;Jl=w([Re("mdui-icon-circle")],Jl);let Ql=class extends ct{render(){return mi('<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"/>')}};Ql.styles=pi;Ql=w([Re("mdui-icon-radio-button-unchecked")],Ql);const S1=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 ti=class extends _i(si(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 Q`<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?Q`<mdui-icon name="${this.uncheckedIcon}" class="i"></mdui-icon>`:Q`<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?Q`<mdui-icon name="${this.checkedIcon}" class="i"></mdui-icon>`:Q`<mdui-icon-circle class="i"></mdui-icon-circle>`}</slot></i><slot part="label" class="label ${e}"></slot>`}isDisabled(){return this.disabled||this.groupDisabled}};ti.styles=[Me,S1];w([D({reflect:!0})],ti.prototype,"value",void 0);w([D({type:Boolean,reflect:!0,converter:me})],ti.prototype,"disabled",void 0);w([D({type:Boolean,reflect:!0,converter:me})],ti.prototype,"checked",void 0);w([D({reflect:!0,attribute:"unchecked-icon"})],ti.prototype,"uncheckedIcon",void 0);w([D({reflect:!0,attribute:"checked-icon"})],ti.prototype,"checkedIcon",void 0);w([Oe()],ti.prototype,"invalid",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"group-disabled"})],ti.prototype,"groupDisabled",void 0);w([Oe()],ti.prototype,"focusable",void 0);w([Oe()],ti.prototype,"isInitial",void 0);w([Ee("checked",!0)],ti.prototype,"onCheckedChange",null);ti=w([Re("mdui-radio")],ti);const k1=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 ui=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(){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&&ht.get(e)?.has(this)?(this.invalid=!1,ht.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 Q`<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})}};ui.styles=[Me,k1];w([D({type:Boolean,reflect:!0,converter:me})],ui.prototype,"disabled",void 0);w([D({reflect:!0})],ui.prototype,"form",void 0);w([D({reflect:!0})],ui.prototype,"name",void 0);w([D({reflect:!0})],ui.prototype,"value",void 0);w([ur()],ui.prototype,"defaultValue",void 0);w([D({type:Boolean,reflect:!0,converter:me})],ui.prototype,"required",void 0);w([Oe()],ui.prototype,"invalid",void 0);w([Ee("value",!0)],ui.prototype,"onValueChange",null);w([Ee("invalid",!0),Ee("disabled")],ui.prototype,"onInvalidChange",null);ui=w([Re("mdui-radio-group")],ui);/**
486
+ )}: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 Ut=class extends On(Di(bi(Ke))){constructor(){super(...arguments),this.disabled=!1,this.active=!1,this.nonclickable=!1,this.rounded=!1,this.alignment="center",this.rippleRef=Me(),this.itemRef=Me(),this.hasSlotController=new $t(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=>Us(a,"mdui-icon")||Tw(a).startsWith("mdui-icon-"),o=Bi({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 Z`<mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.href&&!this.disabled?this.renderAnchor({className:o,content:this.renderInner(),part:"container",refDirective:De(this.itemRef)}):Z`<div part="container" class="${o}" ${De(this.itemRef)}>${this.renderInner()}</div>`}`}renderInner(){const e=this.hasSlotController.test("[default]");return Z`<slot name="custom"><slot name="icon" part="icon" class="icon">${this.icon?Z`<mdui-icon name="${this.icon}"></mdui-icon>`:Qe}</slot><div part="body" class="body">${e?Z`<slot part="headline" class="headline"></slot>`:Z`<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?Z`<mdui-icon name="${this.endIcon}"></mdui-icon>`:Qe}</slot></slot>`}};Ut.styles=[qe,n_];w([L({reflect:!0})],Ut.prototype,"headline",void 0);w([L({type:Number,reflect:!0,attribute:"headline-line"})],Ut.prototype,"headlineLine",void 0);w([L({reflect:!0})],Ut.prototype,"description",void 0);w([L({type:Number,reflect:!0,attribute:"description-line"})],Ut.prototype,"descriptionLine",void 0);w([L({reflect:!0})],Ut.prototype,"icon",void 0);w([L({reflect:!0,attribute:"end-icon"})],Ut.prototype,"endIcon",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ut.prototype,"disabled",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ut.prototype,"active",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ut.prototype,"nonclickable",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ut.prototype,"rounded",void 0);w([L({reflect:!0})],Ut.prototype,"alignment",void 0);w([gi({slot:"icon",flatten:!0})],Ut.prototype,"iconElements",void 0);w([gi({slot:"end-icon",flatten:!0})],Ut.prototype,"endIconElements",void 0);Ut=w([Ae("mdui-list-item")],Ut);const s_=$e`: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 vc=class extends Ke{render(){return Z`<slot></slot>`}};vc.styles=[qe,s_];vc=w([Ae("mdui-list-subheader")],vc);const o_=$e`:host{display:block;padding:.5rem 0}::slotted(mdui-divider[middle]){margin-left:1rem;margin-right:1.5rem}`;let wc=class extends Ke{render(){return Z`<slot></slot>`}};wc.styles=[qe,o_];wc=w([Ae("mdui-list")],wc);let _c=class extends yt{render(){return Ri('<path d="m10 17 5-5-5-5v10z"/>')}};_c.styles=ki;_c=w([Ae("mdui-icon-arrow-right")],_c);const a_=$e`: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 Ct=class extends On(Di(bi(Ke))){constructor(){super(),this.disabled=!1,this.submenuOpen=!1,this.selected=!1,this.dense=!1,this.focusable=!1,this.key=Sr(),this.rippleRef=Me(),this.containerRef=Me(),this.submenuRef=Me(),this.hasSlotController=new $t(this,"[default]","icon","end-icon","end-text","submenu","custom"),this.definedController=new At(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=ti(this,"linear"),r=ti(this,"emphasized-decelerate"),n=ti(this,"emphasized-accelerate");if(this.submenuOpen){if(e&&!this.emit("submenu-open",{cancelable:!0}))return;const s=$i(this,"medium4");await Zt(this.submenuRef.value),this.submenuRef.value.hidden=!1,this.updateSubmenuPositioner(),await Promise.all([st(this.submenuRef.value,[{transform:"scaleY(0.45)"},{transform:"scaleY(1)"}],{duration:e?s:0,easing:r}),st(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=$i(this,"short4");await Zt(this.submenuRef.value),await Promise.all([st(this.submenuRef.value,[{transform:"scaleY(1)"},{transform:"scaleY(0.45)"}],{duration:o,easing:n}),st(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=!gt(this.icon)||this.selects==="single"||this.selects==="multiple"||this.hasSlotController.test("icon"),a=!!this.endText||this.hasSlotController.test("end-text"),c=Bi({container:!0,dense:this.dense,preset:!t,"has-icon":o,"has-end-text":a,"has-end-icon":s});return Z`<mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.href&&!this.disabled?this.renderAnchor({part:"container",className:c,content:this.renderInner(n,o),refDirective:De(this.containerRef),tabIndex:this.focusable?0:-1}):Z`<div part="container" ${De(this.containerRef)} class="${c}">${this.renderInner(n,o)}</div>`} ${at(e,()=>Z`<slot name="submenu" ${De(this.submenuRef)} part="submenu" class="submenu" hidden></slot>`)}`}onOuterClick(e){!this.disabled&&this.submenuOpen&&this!==e.target&&!oe.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=oe(window),t=oe(this.submenuRef.value),r=this.getBoundingClientRect(),n=t.innerWidth(),s=t.innerHeight(),o=8;let a="bottom",c="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?c="right":r.left>n+o&&(c="left"),oe(this.submenuRef.value).css({top:a==="bottom"?0:r.height-s,left:c==="right"?r.width:-n,transformOrigin:[c==="right"?0:"100%",a==="bottom"?0:"100%"].join(" ")})}renderInner(e,t){return Z`<slot name="custom">${this.selected?Z`<slot name="selected-icon" part="selected-icon" class="selected-icon">${this.selectedIcon?Z`<mdui-icon name="${this.selectedIcon}" class="i"></mdui-icon>`:Z`<mdui-icon-check class="i"></mdui-icon-check>`}</slot>`:Z`<slot name="icon" part="icon" class="icon">${t?Z`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:Qe}</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?Z`<mdui-icon-arrow-right part="end-icon" class="end-icon arrow-right"></mdui-icon-arrow-right>`:Z`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?Z`<mdui-icon name="${this.endIcon}"></mdui-icon>`:Qe}</slot>`}</slot>`}};Ct.styles=[qe,a_];w([L({reflect:!0})],Ct.prototype,"value",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ct.prototype,"disabled",void 0);w([L({reflect:!0})],Ct.prototype,"icon",void 0);w([L({reflect:!0,attribute:"end-icon"})],Ct.prototype,"endIcon",void 0);w([L({reflect:!0,attribute:"end-text"})],Ct.prototype,"endText",void 0);w([L({reflect:!0,attribute:"selected-icon"})],Ct.prototype,"selectedIcon",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"submenu-open"})],Ct.prototype,"submenuOpen",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ct.prototype,"selected",void 0);w([Be()],Ct.prototype,"dense",void 0);w([Be()],Ct.prototype,"selects",void 0);w([Be()],Ct.prototype,"submenuTrigger",void 0);w([Be()],Ct.prototype,"submenuOpenDelay",void 0);w([Be()],Ct.prototype,"submenuCloseDelay",void 0);w([Be()],Ct.prototype,"focusable",void 0);w([Re("submenuOpen")],Ct.prototype,"onOpenChange",null);Ct=w([Ae("mdui-menu-item")],Ct);const l_=$e`: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 Wt=class extends Ke{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 At(this,{relatedElements:["mdui-menu-item"]})}get items(){return oe(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!oe(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]:wt(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=oe(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=oe(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 Z`<slot @slotchange="${this.onSlotChange}" @click="${this.onClick}" @keydown="${this.onKeyDown}"></slot>`}setSelectedKeys(e){kn(this.selectedKeys,e)||(this.selectedKeys=e)}setValue(e){this.isSingle||gt(this.value)||gt(e)?this.value=e:kn(this.value,e)||(this.value=e)}getSiblingsItems(e,t=!1){return oe(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?.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 km()}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}}}};Wt.styles=[qe,l_];w([L({reflect:!0})],Wt.prototype,"selects",void 0);w([L()],Wt.prototype,"value",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Wt.prototype,"dense",void 0);w([L({reflect:!0,attribute:"submenu-trigger"})],Wt.prototype,"submenuTrigger",void 0);w([L({type:Number,reflect:!0,attribute:"submenu-open-delay"})],Wt.prototype,"submenuOpenDelay",void 0);w([L({type:Number,reflect:!0,attribute:"submenu-close-delay"})],Wt.prototype,"submenuCloseDelay",void 0);w([Be()],Wt.prototype,"selectedKeys",void 0);w([gi({flatten:!0,selector:"mdui-menu-item"})],Wt.prototype,"childrenItems",void 0);w([Re("dense"),Re("selects"),Re("submenuTrigger"),Re("submenuOpenDelay"),Re("submenuCloseDelay")],Wt.prototype,"onSlotChange",null);w([Re("selects",!0)],Wt.prototype,"onSelectsChange",null);w([Re("selectedKeys",!0)],Wt.prototype,"onSelectedKeysChange",null);w([Re("value")],Wt.prototype,"onValueChange",null);Wt=w([Ae("mdui-menu")],Wt);const c_=$e`: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 Vi=class extends On(Di(bi(Ke))){constructor(){super(...arguments),this.isInitial=!0,this.active=!1,this.disabled=!1,this.key=Sr(),this.rippleRef=Me(),this.hasSlotController=new $t(this,"active-icon")}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return this.disabled}get focusElement(){return this.href?this.renderRoot?.querySelector("._a"):this}get focusDisabled(){return this.disabled}render(){const e=Bi({"label-visibility-selected":this.labelVisibility==="selected","label-visibility-labeled":this.labelVisibility==="labeled","label-visibility-unlabeled":this.labelVisibility==="unlabeled",initial:this.isInitial}),t=Bi([{container:!0,"has-active-icon":this.activeIcon||this.hasSlotController.test("active-icon")},e]);return Z`<mdui-ripple .noRipple="${!this.active||this.noRipple}" class="${e}" ${De(this.rippleRef)}></mdui-ripple>${this.href?this.renderAnchor({part:"container",className:t,content:this.renderInner()}):Z`<div part="container" class="${t}">${this.renderInner()}</div>`}`}renderInner(){return Z`<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?Z`<mdui-icon name="${this.activeIcon}"></mdui-icon>`:Qe}</slot><slot name="icon" part="icon" class="icon">${this.icon?Z`<mdui-icon name="${this.icon}"></mdui-icon>`:Qe}</slot></div><slot part="label" class="label"></slot>`}};Vi.styles=[qe,c_];w([L({reflect:!0})],Vi.prototype,"icon",void 0);w([L({reflect:!0,attribute:"active-icon"})],Vi.prototype,"activeIcon",void 0);w([L({reflect:!0})],Vi.prototype,"value",void 0);w([Be()],Vi.prototype,"labelVisibility",void 0);w([Be()],Vi.prototype,"isInitial",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Vi.prototype,"active",void 0);w([Be()],Vi.prototype,"disabled",void 0);Vi=w([Ae("mdui-navigation-bar-item")],Vi);const d_=$e`: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 _i=class extends Ed(Rr){constructor(){super(...arguments),this.hide=!1,this.labelVisibility="auto",this.activeKey=0,this.isInitial=!0,this.definedController=new At(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?.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?.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 Z`<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()}};_i.styles=[qe,d_];w([L({type:Boolean,reflect:!0,converter:we})],_i.prototype,"hide",void 0);w([L({reflect:!0,attribute:"label-visibility"})],_i.prototype,"labelVisibility",void 0);w([L({reflect:!0})],_i.prototype,"value",void 0);w([L({reflect:!0,attribute:"scroll-behavior"})],_i.prototype,"scrollBehavior",void 0);w([Be()],_i.prototype,"activeKey",void 0);w([gi({selector:"mdui-navigation-bar-item",flatten:!0})],_i.prototype,"items",void 0);w([Re("activeKey",!0)],_i.prototype,"onActiveKeyChange",null);w([Re("value")],_i.prototype,"onValueChange",null);w([Re("labelVisibility",!0)],_i.prototype,"onLabelVisibilityChange",null);_i=w([Ae("mdui-navigation-bar")],_i);const xc=i=>{const e=Er(),t=ii(),r=e.getComputedStyle(t.documentElement),n=tr(i)?oe(i).innerWidth():Jo(i)?i:oe(e).innerWidth(),s=a=>{const c=r.getPropertyValue(`--mdui-breakpoint-${a}`).toLowerCase();return parseFloat(c)},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,c){return this.up(a)&&this.down(c)}}},u_=$e`: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 ri=class extends Rr{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=Me(),this.panelRef=Me(),this.definedController=new At(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(){await this.definedController.whenDefined(),this.observeResize?.unobserve(),this.setObserveResize()}onPlacementChange(){this.isParentLayout&&this.layoutManager.updateLayout(this)}async onMobileChange(){!this.open||this.isParentLayout||this.contained||(await this.definedController.whenDefined(),this.isModal?(bc(this,this.lockTarget),await this.getLockTargetAnimate(!1,0)):(Ss(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=ti(this,"linear"),s=ti(this,"emphasized"),o=(c,l)=>{oe(this.layoutManager.getItemsAndMain()).css("transition",hd(c)?null:`all ${c}ms ${l}`)},a=async()=>{const c=[];if(this.isModal?c.push(t,e):this.isParentLayout||c.push(this.lockTarget),this.isParentLayout){const l=this.layoutManager.getItemsAndMain(),d=l.indexOf(this);c.push(...l.slice(d))}!this.isModal&&!c.includes(this)&&c.push(this),await Promise.all(c.map(l=>Zt(l)))};if(this.open){const c=this.hasUpdated;if(c||(await this.updateComplete,e=this.panelRef.value,t=this.overlayRef.value),c&&!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||bc(this,this.lockTarget)),await a(),requestAnimationFrame(()=>{const u=this.querySelector("[autofocus]");u?u.focus({preventScroll:!0}):e.focus({preventScroll:!0})});const l=$i(this,"long2"),d=[];if(this.isModal?d.push(st(t,[{opacity:0},{opacity:1,offset:.3},{opacity:1}],{duration:c?l:0,easing:n})):this.isParentLayout||d.push(this.getLockTargetAnimate(!0,c?l:0)),this.isParentLayout&&c&&(o(l,s),this.layoutManager.updateLayout(this)),d.push(st(this.isModal?e:this,[{transform:`translateX(${r?"":"-"}100%)`},{transform:"translateX(0)"}],{duration:c?l:0,easing:s})),await Promise.all(d),!this.open)return;this.isParentLayout&&c&&o(null),c&&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 l=$i(this,"short4"),d=[];if(this.isModal?d.push(st(t,[{opacity:1},{opacity:0}],{duration:l,easing:n})):this.isParentLayout||d.push(this.getLockTargetAnimate(!1,l)),this.isParentLayout&&(o(l,s),this.layoutManager.updateLayout(this,{width:0})),d.push(st(this.isModal?e:this,[{transform:"translateX(0)"},{transform:`translateX(${r?"":"-"}100%)`}],{duration:l,easing:s})),await Promise.all(d),this.open)return;this.isParentLayout&&o(null),this.style.display="none",this.isModal&&!this.contained&&Ss(this,this.lockTarget);const u=this.originalTrigger;vt(u?.focus)&&setTimeout(()=>u.focus()),this.emit("closed")}}connectedCallback(){super.connectedCallback(),this.modalHelper=new vm(this),this.definedController.whenDefined().then(()=>{this.setObserveResize()})}disconnectedCallback(){super.disconnectedCallback(),Ss(this,this.lockTarget),this.observeResize?.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 Z`${at(this.isModal,()=>Z`<div ${De(this.overlayRef)} part="overlay" class="overlay" @click="${this.onOverlayClick}"></div>`)}<slot ${De(this.panelRef)} part="panel" class="panel" tabindex="0"></slot>`}setObserveResize(){this.observeResize=kr(this.contained?this.parentElement:document.documentElement,()=>{const e=this.contained?this.parentElement:void 0;this.mobile=xc(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=oe(this.panelRef.value).innerWidth()+"px";return st(this.lockTarget,[{[r]:e?0:n},{[r]:e?n:0}],{duration:t,easing:ti(this,"emphasized"),fill:"forwards"})}};ri.styles=[qe,u_];w([L({type:Boolean,reflect:!0,converter:we})],ri.prototype,"open",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ri.prototype,"modal",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"close-on-esc"})],ri.prototype,"closeOnEsc",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"close-on-overlay-click"})],ri.prototype,"closeOnOverlayClick",void 0);w([L({reflect:!0})],ri.prototype,"placement",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ri.prototype,"contained",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ri.prototype,"mobile",void 0);w([Re("contained",!0)],ri.prototype,"onContainedChange",null);w([Re("placement",!0)],ri.prototype,"onPlacementChange",null);w([Re("mobile",!0),Re("modal",!0)],ri.prototype,"onMobileChange",null);w([Re("open")],ri.prototype,"onOpenChange",null);ri=w([Ae("mdui-navigation-drawer")],ri);const h_=$e`: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 ni=class extends Rr{constructor(){super(...arguments),this.placement="left",this.alignment="start",this.contained=!1,this.divider=!1,this.activeKey=0,this.hasSlotController=new $t(this,"top","bottom"),this.definedController=new At(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(oe(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?.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?.key??0,this.updateItems()}async onContainedChange(){this.isParentLayout||(await this.definedController.whenDefined(),oe(document.body).css({paddingLeft:this.contained||this.isRight?null:this.paddingValue,paddingRight:this.contained||!this.isRight?null:this.paddingValue}),oe(this.parentElement).css({paddingLeft:this.contained&&!this.isRight?this.paddingValue:null,paddingRight:this.contained&&this.isRight?this.paddingValue:null}))}async onPlacementChange(){await this.definedController.whenDefined(),this.layoutManager?.updateLayout(this),this.items.forEach(e=>{e.placement=this.placement}),this.isParentLayout||oe(this.parentTarget).css({paddingLeft:this.isRight?null:this.paddingValue,paddingRight:this.isRight?this.paddingValue:null})}connectedCallback(){super.connectedCallback(),this.isParentLayout||this.definedController.whenDefined().then(()=>{oe(this.parentTarget).css({paddingLeft:this.isRight?null:this.paddingValue,paddingRight:this.isRight?this.paddingValue:null})})}disconnectedCallback(){super.disconnectedCallback(),!this.isParentLayout&&this.definedController.isDefined()&&oe(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 Z`${at(e,()=>Z`<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> ${at(t,()=>Z`<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()}};ni.styles=[qe,h_];w([L({reflect:!0})],ni.prototype,"value",void 0);w([L({reflect:!0})],ni.prototype,"placement",void 0);w([L({reflect:!0})],ni.prototype,"alignment",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ni.prototype,"contained",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ni.prototype,"divider",void 0);w([Be()],ni.prototype,"activeKey",void 0);w([gi({selector:"mdui-navigation-rail-item",flatten:!0})],ni.prototype,"items",void 0);w([Re("activeKey",!0)],ni.prototype,"onActiveKeyChange",null);w([Re("value")],ni.prototype,"onValueChange",null);w([Re("contained",!0)],ni.prototype,"onContainedChange",null);w([Re("placement",!0)],ni.prototype,"onPlacementChange",null);ni=w([Ae("mdui-navigation-rail")],ni);const f_=$e`: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 zi=class extends On(Di(bi(Ke))){constructor(){super(...arguments),this.active=!1,this.isInitial=!0,this.placement="left",this.disabled=!1,this.key=Sr(),this.rippleRef=Me(),this.hasSlotController=new $t(this,"[default]","active-icon")}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return this.disabled}get focusElement(){return this.href?this.renderRoot?.querySelector("._a"):this}get focusDisabled(){return this.disabled}render(){const e=this.hasSlotController.test("[default]"),t=Bi({container:!0,"has-label":e,"has-active-icon":this.activeIcon||this.hasSlotController.test("active-icon"),initial:this.isInitial});return Z`${this.href?this.renderAnchor({part:"container",className:t,content:this.renderInner(e)}):Z`<div part="container" class="${t}">${this.renderInner(e)}</div>`}<mdui-ripple .noRipple="${!this.active||this.noRipple}" ${De(this.rippleRef)}></mdui-ripple>`}renderInner(e){return Z`<div part="indicator" class="indicator"><slot name="badge" part="badge" class="${bt({badge:!0,"placement-right":this.placement==="right"})}"></slot><slot name="active-icon" part="active-icon" class="active-icon">${this.activeIcon?Z`<mdui-icon name="${this.activeIcon}"></mdui-icon>`:Qe}</slot><slot name="icon" part="icon" class="icon">${this.icon?Z`<mdui-icon name="${this.icon}"></mdui-icon>`:Qe}</slot></div>${e?Z`<slot part="label" class="label"></slot>`:it}`}};zi.styles=[qe,f_];w([L({reflect:!0})],zi.prototype,"icon",void 0);w([L({reflect:!0,attribute:"active-icon"})],zi.prototype,"activeIcon",void 0);w([L({reflect:!0})],zi.prototype,"value",void 0);w([L({type:Boolean,reflect:!0,converter:we})],zi.prototype,"active",void 0);w([Be()],zi.prototype,"isInitial",void 0);w([Be()],zi.prototype,"placement",void 0);w([Be()],zi.prototype,"disabled",void 0);zi=w([Ae("mdui-navigation-rail-item")],zi);let Ec=class extends yt{render(){return Ri('<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=ki;Ec=w([Ae("mdui-icon-circle")],Ec);let Sc=class extends yt{render(){return Ri('<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"/>')}};Sc.styles=ki;Sc=w([Ae("mdui-icon-radio-button-unchecked")],Sc);const p_=$e`: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 fi=class extends Di(bi(Ke)){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=Me()}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=bt({invalid:this.invalid,initial:this.isInitial});return Z`<i part="control" class="${e}"><mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><slot name="unchecked-icon" part="unchecked-icon" class="icon unchecked-icon">${this.uncheckedIcon?Z`<mdui-icon name="${this.uncheckedIcon}" class="i"></mdui-icon>`:Z`<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?Z`<mdui-icon name="${this.checkedIcon}" class="i"></mdui-icon>`:Z`<mdui-icon-circle class="i"></mdui-icon-circle>`}</slot></i><slot part="label" class="label ${e}"></slot>`}isDisabled(){return this.disabled||this.groupDisabled}};fi.styles=[qe,p_];w([L({reflect:!0})],fi.prototype,"value",void 0);w([L({type:Boolean,reflect:!0,converter:we})],fi.prototype,"disabled",void 0);w([L({type:Boolean,reflect:!0,converter:we})],fi.prototype,"checked",void 0);w([L({reflect:!0,attribute:"unchecked-icon"})],fi.prototype,"uncheckedIcon",void 0);w([L({reflect:!0,attribute:"checked-icon"})],fi.prototype,"checkedIcon",void 0);w([Be()],fi.prototype,"invalid",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"group-disabled"})],fi.prototype,"groupDisabled",void 0);w([Be()],fi.prototype,"focusable",void 0);w([Be()],fi.prototype,"isInitial",void 0);w([Re("checked",!0)],fi.prototype,"onCheckedChange",null);fi=w([Ae("mdui-radio")],fi);const m_=$e`: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 xi=class extends Ke{constructor(){super(...arguments),this.disabled=!1,this.name="",this.value="",this.defaultValue="",this.required=!1,this.invalid=!1,this.isInitial=!0,this.inputRef=Me(),this.formController=new lr(this),this.definedController=new At(this,{relatedElements:["mdui-radio"]})}get validity(){return this.inputRef.value.validity}get validationMessage(){return this.inputRef.value.validationMessage}get items(){return oe(this).find("mdui-radio").get()}get itemsEnabled(){return oe(this).find("mdui-radio:not([disabled])").get()}async onValueChange(){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&&xt.get(e)?.has(this)?(this.invalid=!1,xt.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 Z`<fieldset><input ${De(this.inputRef)} type="radio" class="input" name="${je(this.name)}" value="${je(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})}};xi.styles=[qe,m_];w([L({type:Boolean,reflect:!0,converter:we})],xi.prototype,"disabled",void 0);w([L({reflect:!0})],xi.prototype,"form",void 0);w([L({reflect:!0})],xi.prototype,"name",void 0);w([L({reflect:!0})],xi.prototype,"value",void 0);w([Ir()],xi.prototype,"defaultValue",void 0);w([L({type:Boolean,reflect:!0,converter:we})],xi.prototype,"required",void 0);w([Be()],xi.prototype,"invalid",void 0);w([Re("value",!0)],xi.prototype,"onValueChange",null);w([Re("invalid",!0),Re("disabled")],xi.prototype,"onInvalidChange",null);xi=w([Ae("mdui-radio-group")],xi);/**
462
487
  * @license
463
488
  * Copyright 2021 Google LLC
464
489
  * SPDX-License-Identifier: BSD-3-Clause
465
- */function*Ur(i,e){if(i!==void 0){let t=0;for(const r of i)yield e(r,t++)}}const I1=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 Et extends _i(si(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,()=>Q`<div part="label" class="label ${lt({"label-visible":this.labelVisible})}">${this.labelFormatter(e)}</div>`)}onChange(){this.emit("change")}}Et.styles=[Me,I1];w([D({type:Number,reflect:!0})],Et.prototype,"min",void 0);w([D({type:Number,reflect:!0})],Et.prototype,"max",void 0);w([D({type:Number,reflect:!0})],Et.prototype,"step",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Et.prototype,"tickmarks",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Et.prototype,"nolabel",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Et.prototype,"disabled",void 0);w([D({reflect:!0})],Et.prototype,"form",void 0);w([D({reflect:!0})],Et.prototype,"name",void 0);w([Oe()],Et.prototype,"invalid",void 0);w([Oe()],Et.prototype,"labelVisible",void 0);w([D({attribute:!1})],Et.prototype,"labelFormatter",void 0);w([Ee("disabled",!0)],Et.prototype,"onDisabledChange",null);let nn=class extends Et{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(()=>{this.updateStyle();const r=this.formController.getForm();r&&ht.get(r)?.has(this)?(this.invalid=!1,ht.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 Q`<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="${wr({"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="${wr({"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,()=>Ur(this.getCandidateValues(),e=>Q`<div part="tickmark" class="tickmark ${lt({active:e>this.value[0]&&e<this.value[1]})}" style="${wr({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=[Et.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 R1=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(
490
+ */function*hn(i,e){if(i!==void 0){let t=0;for(const r of i)yield e(r,t++)}}const g_=$e`: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 Pt extends Di(bi(Ke)){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=Me(),this.trackActiveRef=Me(),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 at(!this.nolabel,()=>Z`<div part="label" class="label ${bt({"label-visible":this.labelVisible})}">${this.labelFormatter(e)}</div>`)}onChange(){this.emit("change")}}Pt.styles=[qe,g_];w([L({type:Number,reflect:!0})],Pt.prototype,"min",void 0);w([L({type:Number,reflect:!0})],Pt.prototype,"max",void 0);w([L({type:Number,reflect:!0})],Pt.prototype,"step",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Pt.prototype,"tickmarks",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Pt.prototype,"nolabel",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Pt.prototype,"disabled",void 0);w([L({reflect:!0})],Pt.prototype,"form",void 0);w([L({reflect:!0})],Pt.prototype,"name",void 0);w([Be()],Pt.prototype,"invalid",void 0);w([Be()],Pt.prototype,"labelVisible",void 0);w([L({attribute:!1})],Pt.prototype,"labelFormatter",void 0);w([Re("disabled",!0)],Pt.prototype,"onDisabledChange",null);let In=class extends Pt{constructor(){super(...arguments),this.defaultValue=[],this.currentHandle="start",this.rippleStartRef=Me(),this.rippleEndRef=Me(),this.handleStartRef=Me(),this.handleEndRef=Me(),this.formController=new lr(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(()=>{this.updateStyle();const r=this.formController.getForm();r&&xt.get(r)?.has(this)?(this.invalid=!1,xt.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=oe(this),a=parseFloat(o.css("padding-left")),c=parseFloat(o.css("padding-right")),l=(s.offsetX-a)/(this.clientWidth-a-c),d=(this.max-this.min)*l+this.min,u=(this.value[1]-this.value[0])/2+this.value[0];return d>u?"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 Z`<label class="${bt({invalid:this.invalid})}"><input ${De(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 ${De(this.trackActiveRef)} part="track-active" class="track-active"></div><div ${De(this.handleStartRef)} part="handle" class="handle start" style="${jr({"z-index":this.currentHandle==="start"?"2":"1"})}"><div class="elevation"></div><mdui-ripple ${De(this.rippleStartRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.renderLabel(this.value[0])}</div><div ${De(this.handleEndRef)} part="handle" class="handle end" style="${jr({"z-index":this.currentHandle==="end"?"2":"1"})}"><div class="elevation"></div><mdui-ripple ${De(this.rippleEndRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.renderLabel(this.value[1])}</div>${at(this.tickmarks,()=>hn(this.getCandidateValues(),e=>Z`<div part="tickmark" class="tickmark ${bt({active:e>this.value[0]&&e<this.value[1]})}" style="${jr({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())}};In.styles=[Pt.styles];w([Ir()],In.prototype,"defaultValue",void 0);w([Be()],In.prototype,"currentHandle",void 0);w([L({type:Array,attribute:!1})],In.prototype,"value",null);In=w([Ae("mdui-range-slider")],In);const b_=$e`: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(
466
491
  --mdui-color-on-secondary-container
467
- )}: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=Ti({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 Q`<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?Q`<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?Q`<slot name="selected-icon" part="selected-icon" class="selected-icon">${this.selectedIcon?Q`<mdui-icon name="${this.selectedIcon}" class="i"></mdui-icon>`:Q`<mdui-icon-check class="i"></mdui-icon-check>`}</slot>`:Q`<slot name="icon" part="icon" class="icon">${this.icon?Q`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:He}</slot>`}renderLabel(){return this.hasSlotController.test("[default]")?Q`<slot part="label" class="label"></slot>`:He}renderEndIcon(){return Q`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?Q`<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`:He}</slot>`}renderInner(){return[this.renderIcon(),this.renderLabel(),this.renderEndIcon()]}};zi.styles=[ot.styles,R1];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 T1=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 xt=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(){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(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));if(this.updateItems(),!this.isInitial){const t=this.formController.getForm();t&&ht.get(t)?.has(this)?(this.invalid=!1,ht.get(t).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 Q`${Ye(this.isSelectable&&this.isSingle,()=>Q`<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,()=>Q`<select ${$e(this.inputRef)} name="${De(this.name)}" .disabled="${this.disabled}" .required="${this.required}" multiple="multiple" tabindex="-1" @keydown="${this.onInputKeyDown}">${Ur(this.value,e=>Q`<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))})}};xt.styles=[Me,T1];w([D({type:Boolean,reflect:!0,converter:me,attribute:"full-width"})],xt.prototype,"fullWidth",void 0);w([D({reflect:!0})],xt.prototype,"selects",void 0);w([D({type:Boolean,reflect:!0,converter:me})],xt.prototype,"disabled",void 0);w([D({type:Boolean,reflect:!0,converter:me})],xt.prototype,"required",void 0);w([D({reflect:!0})],xt.prototype,"form",void 0);w([D({reflect:!0})],xt.prototype,"name",void 0);w([D()],xt.prototype,"value",void 0);w([ur()],xt.prototype,"defaultValue",void 0);w([Oe()],xt.prototype,"selectedKeys",void 0);w([Oe()],xt.prototype,"invalid",void 0);w([Ee("selects",!0)],xt.prototype,"onSelectsChange",null);w([Ee("selectedKeys",!0)],xt.prototype,"onSelectedKeysChange",null);w([Ee("value")],xt.prototype,"onValueChange",null);w([Ee("invalid",!0),Ee("disabled")],xt.prototype,"onInvalidChange",null);xt=w([Re("mdui-segmented-button-group")],xt);let Xl=class extends ct{render(){return mi('<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"/>')}};Xl.styles=pi;Xl=w([Re("mdui-icon-cancel--outlined")],Xl);let Yl=class extends ct{render(){return mi('<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"/>')}};Yl.styles=pi;Yl=w([Re("mdui-icon-error")],Yl);let Zl=class extends ct{render(){return mi('<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"/>')}};Zl.styles=pi;Zl=w([Re("mdui-icon-visibility-off")],Zl);let ec=class extends ct{render(){return mi('<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"/>')}};ec.styles=pi;ec=w([Re("mdui-icon-visibility")],ec);const $1=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 si(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(){return this.inputRef.value?.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(){if(this.hasValue=!["",null].includes(this.value),this.hasUpdated){await this.updateComplete,this.setTextareaHeight();const e=this.formController.getForm();e&&ht.get(e)?.has(this)?(this.invalid=!1,ht.get(e).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(){super.disconnectedCallback(),this.observeResize?.unobserve(),Vs(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),Vs(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 Q`<div part="container" class="${y}">${this.renderPrefix()}<div class="input-container">${this.renderLabel()} ${this.isTextarea?this.renderTextArea(f):this.renderInput(f)} ${Ye(f,()=>Q`<slot name="input" class="input"></slot>`)}</div>${this.renderSuffix()}${this.renderClearButton(s)} ${this.renderTogglePasswordButton(n)} ${this.renderRightIcon(r)}</div>${Ye(c||l||d,()=>Q`<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()),Xw(this,()=>{this.setCustomValidityInternal(this.getPatternErrorMsg())})):(this.setCustomValidityInternal(""),Vs(this))}}onTogglePassword(){this.isPasswordVisible=!this.isPasswordVisible}getPatternErrorMsg(){return Kw("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?Q`<label part="label" class="label">${this.label}</label>`:He}renderPrefix(){return Q`<slot name="icon" part="icon" class="icon">${this.icon?Q`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:He}</slot><slot name="prefix" part="prefix" class="prefix">${this.prefix}</slot>`}renderSuffix(){return Q`<slot name="suffix" part="suffix" class="suffix">${this.suffix}</slot>`}renderRightIcon(e){return e?Q`<slot name="error-icon" part="error-icon" class="right-icon">${this.errorIcon?Q`<mdui-icon name="${this.errorIcon}" class="i"></mdui-icon>`:Q`<mdui-icon-error class="i"></mdui-icon-error>`}</slot>`:Q`<slot name="end-icon" part="end-icon" class="end-icon right-icon">${this.endIcon?Q`<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`:He}</slot>`}renderClearButton(e){return Ye(e,()=>Q`<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?Q`<mdui-icon name="${this.clearIcon}" class="i"></mdui-icon>`:Q`<mdui-icon-cancel--outlined class="i"></mdui-icon-cancel--outlined>`}</slot></mdui-button-icon></slot>`)}renderTogglePasswordButton(e){return Ye(e,()=>Q`<slot name="toggle-password-button" part="toggle-password-button" class="action" @click="${this.onTogglePassword}"><mdui-button-icon tabindex="-1">${this.isPasswordVisible?Q`<slot name="show-password-icon" part="show-password-icon">${this.showPasswordIcon?Q`<mdui-icon name="${this.showPasswordIcon}" class="i"></mdui-icon>`:Q`<mdui-icon-visibility-off class="i"></mdui-icon-visibility-off>`}</slot>`:Q`<slot name="hide-password-icon" part="hide-password-icon">${this.hidePasswordIcon?Q`<mdui-icon name="${this.hidePasswordIcon}" class="i"></mdui-icon>`:Q`<mdui-icon-visibility class="i"></mdui-icon-visibility>`}</slot>`}</mdui-button-icon></slot>`)}renderInput(e){return Q`<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 Q`<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?Q`<div part="error" class="error">${this.error||this.inputRef.value.validationMessage}</div>`:t?Q`<slot name="helper" part="helper" class="helper">${this.helper}</slot>`:Q`<span></span>`}renderCounter(e){return e?Q`<div part="counter" class="counter">${this.value.length}/${this.maxlength}</div>`:He}};Te.styles=[Me,$1];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 C1=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 si(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(){super.disconnectedCallback(),this.observeResize?.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(){const e=this.multiple?!!this.value.length:!!this.value;return Q`${this.multiple?Q`<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">${Ur(this.value,t=>Q`<option selected="selected" value="${t}"></option>`)}</select>`:Q`<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(t=>`${t}:text-field__${t}`).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="${this.hiddenInputRef.value?.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="${t=>t.stopPropagation()}" @keydown="${this.onTextFieldKeyDown}">${Ur(["icon","end-icon","error-icon","prefix","suffix","clear-button","clear-icon","helper"],t=>this.hasSlotController.test(t)?Q`<slot name="${t}" slot="${t}"></slot>`:Ge)} ${Ye(this.multiple&&this.value.length,()=>Q`<div slot="input" class="chips" part="chips">${Ur(this.value,t=>Q`<mdui-chip class="chip" part="chip" exportparts="${["button","label","delete-icon"].map(r=>`${r}:chip__${r}`).join(",")}" variant="input" deletable tabindex="-1" @delete="${()=>this.onDeleteOneValue(t)}">${this.getMenuItemLabelByValue(t)}</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){return this.menuItems.length&&this.menuItems.find(t=>t.value===e)?.textContent?.trim()||e}resizeMenu(){this.menuRef.value.style.width=`${this.textFieldRef.value.clientWidth}px`}async onDropdownOpen(){this.textFieldRef.value.focusedStyle=!0}onDropdownClose(){this.textFieldRef.value.focusedStyle=!1,(this.contains(document.activeElement)||this.contains(document.activeElement?.assignedSlot??null))&&setTimeout(()=>{this.focus()})}async onValueChange(e){const t=e.target;this.value=this.multiple?t.value.map(n=>n??""):t.value??"",await this.updateComplete;const r=this.formController.getForm();r&&ht.get(r)?.has(this)?(this.invalid=!1,ht.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,C1];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([ni({flatten:!0,selector:"mdui-menu-item"})],Xe.prototype,"menuItems",void 0);Xe=w([Re("mdui-select")],Xe);const A1=Ie`.track-active{left:-.125rem;border-radius:var(--mdui-shape-corner-full) 0 0 var(--mdui-shape-corner-full)}`;let sn=class extends Et{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(){this.value=this.fixValue(this.value);const e=this.formController.getForm();e&&ht.get(e)?.has(this)?(this.invalid=!1,ht.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 Q`<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,()=>Ur(this.getCandidateValues(),e=>Q`<div part="tickmark" class="tickmark ${lt({active:e<this.value})}" style="${wr({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=[Et.styles,A1];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 N1=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}`,Ei=[];let vl=!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))]),Ei.push({height:this.clientHeight,snackbar:this}),await this.reorderStack(this);const n=bi(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=bi(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=Ei.findIndex(o=>o.snackbar===this);Ei.splice(s,1),Ei[s]&&await this.reorderStack(Ei[s].snackbar);return}}async onStackChange(){await this.reorderStack(this)}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this.onDocumentClick),this.mobile=Kl().down("sm"),this.observeResize=cr(document.documentElement,async()=>{const e=Kl().down("sm");this.mobile!==e&&(this.mobile=e,vl||(vl=!0,await this.reorderStack(),vl=!1))})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentClick),window.clearTimeout(this.closeTimeout),this.open&&(this.open=!1),this.observeResize?.unobserve()}render(){return Q`<slot part="message" class="message"></slot><div class="action-group"><slot name="action" part="action" class="action" @click="${this.onActionClick}">${this.action?Q`<mdui-button variant="text" loading="${this.actionLoading}">${this.action}</mdui-button>`:He}</slot>${Ye(this.closeable,()=>Q`<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?Q`<mdui-icon name="${this.closeIcon}" class="i"></mdui-icon>`:Q`<mdui-icon-clear class="i"></mdui-icon-clear>`}</slot></mdui-button-icon></slot>`)}</div>`}async reorderStack(e){const t=e?Ei.findIndex(r=>r.snackbar===e):0;for(let r=t;r<Ei.length;r++){const s=Ei[r].snackbar;this.mobile?["top","bottom"].forEach(o=>{if(s.placement.startsWith(o)){const a=Ei.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=Ei.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,N1];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 L1=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 _i(si(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(){await this.updateComplete;const e=this.formController.getForm();e&&ht.get(e)?.has(this)?(this.invalid=!1,ht.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 Q`<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?Q`<mdui-icon name="${this.checkedIcon}" class="i"></mdui-icon>`:this.checkedIcon===""?He:Q`<mdui-icon-check class="i"></mdui-icon-check>`}</slot><slot name="unchecked-icon" part="unchecked-icon" class="unchecked-icon">${this.uncheckedIcon?Q`<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,L1];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 D1=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 _i(si(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=()=>Q`<slot name="badge"></slot>`;return Q`<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?Q`<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,D1];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 O1=Ie`:host{display:block;overflow-y:auto;flex:1 1 auto}:host(:not([active])){display:none}`;let cs=class extends Ue{constructor(){super(...arguments),this.active=!1}render(){return Q`<slot></slot>`}};cs.styles=[Me,O1];w([D({reflect:!0})],cs.prototype,"value",void 0);w([D({type:Boolean,reflect:!0,converter:me})],cs.prototype,"active",void 0);cs=w([Re("mdui-tab-panel")],cs);const M1=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(){await this.definedController.whenDefined(),this.value=this.tabs.find(e=>e.key===this.activeKey)?.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?.key??0}async onIndicatorChange(){await this.updateComplete,this.updateIndicator()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.observeResize=cr(this.containerRef.value,()=>this.updateIndicator())})}disconnectedCallback(){super.disconnectedCallback(),this.observeResize?.unobserve()}render(){return Q`<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=>e.active=e.value===this.activeTab?.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,M1];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([ni({selector:"mdui-tab",flatten:!0})],Gt.prototype,"tabs",void 0);w([ni({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 P1{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 j1=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 P1(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=bi(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=io(this.target),this.overflowAncestors.forEach(e=>{e.addEventListener("scroll",this.onWindowScroll)}),this.observeResize=cr(this.target,()=>{this.updatePositioner()})})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentClick),this.overflowAncestors?.forEach(e=>{e.removeEventListener("scroll",this.onWindowScroll)}),this.observeResize?.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 Q`<slot></slot><div ${$e(this.popupRef)} part="popup" class="popup" hidden>${Ye(e,()=>Q`<slot name="headline" part="headline" class="headline">${this.headline}</slot>`)}<slot name="content" part="content" class="content">${this.content}</slot>${Ye(t,()=>Q`<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,j1];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 B1=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},F1=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 ds=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 Q`<slot part="label" class="label ${t}" ${$e(this.defaultSlotRef)} @slotchange="${()=>this.onSlotChange(e)}"></slot>${e?Q`<slot name="label-large" part="label-large" class="label-large ${t}"></slot>`:Q`<div ${$e(this.labelLargeRef)} part="label-large" class="label-large ${t}"></div>`}`}onSlotChange(e){e||(this.labelLargeRef.value.innerHTML=B1(this.defaultSlotRef.value))}};ds.styles=[Me,F1];w([Oe()],ds.prototype,"variant",void 0);w([Oe()],ds.prototype,"shrink",void 0);ds=w([Re("mdui-top-app-bar-title")],ds);const q1=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 vi=class extends Jc(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 Q`<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))}};vi.styles=[Me,q1];w([D({reflect:!0})],vi.prototype,"variant",void 0);w([D({type:Boolean,reflect:!0,converter:me})],vi.prototype,"hide",void 0);w([D({type:Boolean,reflect:!0,converter:me})],vi.prototype,"shrink",void 0);w([D({reflect:!0,attribute:"scroll-behavior"})],vi.prototype,"scrollBehavior",void 0);w([D({type:Boolean,reflect:!0,converter:me})],vi.prototype,"scrolling",void 0);w([ni({selector:"mdui-top-app-bar-title",flatten:!0})],vi.prototype,"titleElements",void 0);w([Ee("variant")],vi.prototype,"onVariantChange",null);w([Ee("shrink")],vi.prototype,"onShrinkChange",null);vi=w([Re("mdui-top-app-bar")],vi);/**
492
+ )}: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 nr=class extends pt{constructor(){super(...arguments),this.selected=!1,this.invalid=!1,this.groupDisabled=!1,this.key=Sr(),this.rippleRef=Me(),this.hasSlotController=new $t(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=Bi({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 Z`<mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:e,part:"button",content:this.renderInner()}):this.isDisabled()||this.loading?Z`<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?Z`<slot name="selected-icon" part="selected-icon" class="selected-icon">${this.selectedIcon?Z`<mdui-icon name="${this.selectedIcon}" class="i"></mdui-icon>`:Z`<mdui-icon-check class="i"></mdui-icon-check>`}</slot>`:Z`<slot name="icon" part="icon" class="icon">${this.icon?Z`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:Qe}</slot>`}renderLabel(){return this.hasSlotController.test("[default]")?Z`<slot part="label" class="label"></slot>`:Qe}renderEndIcon(){return Z`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?Z`<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`:Qe}</slot>`}renderInner(){return[this.renderIcon(),this.renderLabel(),this.renderEndIcon()]}};nr.styles=[pt.styles,b_];w([L({reflect:!0})],nr.prototype,"icon",void 0);w([L({reflect:!0,attribute:"end-icon"})],nr.prototype,"endIcon",void 0);w([L({reflect:!0,attribute:"selected-icon"})],nr.prototype,"selectedIcon",void 0);w([L({type:Boolean,reflect:!0,converter:we})],nr.prototype,"selected",void 0);w([L({type:Boolean,reflect:!0,converter:we})],nr.prototype,"invalid",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"group-disabled"})],nr.prototype,"groupDisabled",void 0);nr=w([Ae("mdui-segmented-button")],nr);const y_=$e`: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 Ot=class extends Ke{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=Me(),this.formController=new lr(this),this.definedController=new At(this,{relatedElements:["mdui-segmented-button"]})}get validity(){return this.inputRef.value.validity}get validationMessage(){return this.inputRef.value.validationMessage}get items(){return oe(this).find("mdui-segmented-button").get()}get itemsEnabled(){return oe(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(){if(this.isInitial=!this.hasUpdated,await this.definedController.whenDefined(),!this.isSelectable){this.updateItems();return}const e=(this.isSingle?[this.value]:wt(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));if(this.updateItems(),!this.isInitial){const t=this.formController.getForm();t&&xt.get(t)?.has(this)?(this.invalid=!1,xt.get(t).delete(this)):this.invalid=!this.inputRef.value.checkValidity()}}async onInvalidChange(){await this.definedController.whenDefined(),this.updateItems()}connectedCallback(){super.connectedCallback(),this.value=this.isMultiple&&wt(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 Z`${at(this.isSelectable&&this.isSingle,()=>Z`<input ${De(this.inputRef)} type="radio" name="${je(this.name)}" value="1" .disabled="${this.disabled}" .required="${this.required}" .checked="${!!this.value}" tabindex="-1" @keydown="${this.onInputKeyDown}">`)}${at(this.isSelectable&&this.isMultiple,()=>Z`<select ${De(this.inputRef)} name="${je(this.name)}" .disabled="${this.disabled}" .required="${this.required}" multiple="multiple" tabindex="-1" @keydown="${this.onInputKeyDown}">${hn(this.value,e=>Z`<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){kn(this.selectedKeys,e)||(this.selectedKeys=e)}setValue(e){this.isSingle?this.value=e:kn(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))})}};Ot.styles=[qe,y_];w([L({type:Boolean,reflect:!0,converter:we,attribute:"full-width"})],Ot.prototype,"fullWidth",void 0);w([L({reflect:!0})],Ot.prototype,"selects",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ot.prototype,"disabled",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ot.prototype,"required",void 0);w([L({reflect:!0})],Ot.prototype,"form",void 0);w([L({reflect:!0})],Ot.prototype,"name",void 0);w([L()],Ot.prototype,"value",void 0);w([Ir()],Ot.prototype,"defaultValue",void 0);w([Be()],Ot.prototype,"selectedKeys",void 0);w([Be()],Ot.prototype,"invalid",void 0);w([Re("selects",!0)],Ot.prototype,"onSelectsChange",null);w([Re("selectedKeys",!0)],Ot.prototype,"onSelectedKeysChange",null);w([Re("value")],Ot.prototype,"onValueChange",null);w([Re("invalid",!0),Re("disabled")],Ot.prototype,"onInvalidChange",null);Ot=w([Ae("mdui-segmented-button-group")],Ot);let kc=class extends yt{render(){return Ri('<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"/>')}};kc.styles=ki;kc=w([Ae("mdui-icon-cancel--outlined")],kc);let Rc=class extends yt{render(){return Ri('<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=ki;Rc=w([Ae("mdui-icon-error")],Rc);let Ic=class extends yt{render(){return Ri('<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"/>')}};Ic.styles=ki;Ic=w([Ae("mdui-icon-visibility-off")],Ic);let Tc=class extends yt{render(){return Ri('<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"/>')}};Tc.styles=ki;Tc=w([Ae("mdui-icon-visibility")],Tc);const v_=$e`: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 Ne=class extends bi(Ke){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=Me(),this.formController=new lr(this),this.hasSlotController=new $t(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(){return this.inputRef.value?.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(){if(this.hasValue=!["",null].includes(this.value),this.hasUpdated){await this.updateComplete,this.setTextareaHeight();const e=this.formController.getForm();e&&xt.get(e)?.has(this)?(this.invalid=!1,xt.get(e).delete(this)):this.invalid=!this.inputRef.value.checkValidity()}}onRowsChange(){this.setTextareaHeight()}async onMaxRowsChange(){if(!this.autosize)return;this.hasUpdated||await this.updateComplete;const e=oe(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=oe(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=kr(this.inputRef.value,()=>this.setTextareaHeight())})}disconnectedCallback(){super.disconnectedCallback(),this.observeResize?.unobserve(),_o(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),_o(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"),c=!!this.helper||this.hasSlotController.test("helper"),l=r&&!!(this.error||this.inputRef.value.validationMessage),d=this.counter&&!!this.maxlength,u=this.hasSlotController.test("input"),p={invalid:this.invalid,"invalid-style":this.invalidStyle},g=bt({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"),...p});return Z`<div part="container" class="${g}">${this.renderPrefix()}<div class="input-container">${this.renderLabel()} ${this.isTextarea?this.renderTextArea(u):this.renderInput(u)} ${at(u,()=>Z`<slot name="input" class="input"></slot>`)}</div>${this.renderSuffix()}${this.renderClearButton(s)} ${this.renderTogglePasswordButton(n)} ${this.renderRightIcon(r)}</div>${at(l||c||d,()=>Z`<div part="supporting" class="${bt({supporting:!0,...p})}">${this.renderHelper(l,c)} ${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()),q1(this,()=>{this.setCustomValidityInternal(this.getPatternErrorMsg())})):(this.setCustomValidityInternal(""),_o(this))}}onTogglePassword(){this.isPasswordVisible=!this.isPasswordVisible}getPatternErrorMsg(){return F1("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?Z`<label part="label" class="label">${this.label}</label>`:Qe}renderPrefix(){return Z`<slot name="icon" part="icon" class="icon">${this.icon?Z`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:Qe}</slot><slot name="prefix" part="prefix" class="prefix">${this.prefix}</slot>`}renderSuffix(){return Z`<slot name="suffix" part="suffix" class="suffix">${this.suffix}</slot>`}renderRightIcon(e){return e?Z`<slot name="error-icon" part="error-icon" class="right-icon">${this.errorIcon?Z`<mdui-icon name="${this.errorIcon}" class="i"></mdui-icon>`:Z`<mdui-icon-error class="i"></mdui-icon-error>`}</slot>`:Z`<slot name="end-icon" part="end-icon" class="end-icon right-icon">${this.endIcon?Z`<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`:Qe}</slot>`}renderClearButton(e){return at(e,()=>Z`<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?Z`<mdui-icon name="${this.clearIcon}" class="i"></mdui-icon>`:Z`<mdui-icon-cancel--outlined class="i"></mdui-icon-cancel--outlined>`}</slot></mdui-button-icon></slot>`)}renderTogglePasswordButton(e){return at(e,()=>Z`<slot name="toggle-password-button" part="toggle-password-button" class="action" @click="${this.onTogglePassword}"><mdui-button-icon tabindex="-1">${this.isPasswordVisible?Z`<slot name="show-password-icon" part="show-password-icon">${this.showPasswordIcon?Z`<mdui-icon name="${this.showPasswordIcon}" class="i"></mdui-icon>`:Z`<mdui-icon-visibility-off class="i"></mdui-icon-visibility-off>`}</slot>`:Z`<slot name="hide-password-icon" part="hide-password-icon">${this.hidePasswordIcon?Z`<mdui-icon name="${this.hidePasswordIcon}" class="i"></mdui-icon>`:Z`<mdui-icon-visibility class="i"></mdui-icon-visibility>`}</slot>`}</mdui-button-icon></slot>`)}renderInput(e){return Z`<input ${De(this.inputRef)} part="input" class="input ${bt({"hide-input":e})}" type="${this.type==="password"&&this.isPasswordVisible?"text":this.type}" name="${je(this.name)}" .value="${Sn(this.value)}" placeholder="${je(!this.label||this.isFocusedStyle||this.hasValue?this.placeholder:void 0)}" ?readonly="${this.readonly}" ?disabled="${this.disabled}" ?required="${this.required}" minlength="${je(this.minlength)}" maxlength="${je(this.maxlength)}" min="${je(this.min)}" max="${je(this.max)}" step="${je(this.step)}" autocapitalize="${je(this.type==="password"?"off":this.autocapitalize)}" autocomplete="${this.autocomplete}" autocorrect="${je(this.type==="password"?"off":this.autocorrect)}" spellcheck="${je(this.spellcheck)}" pattern="${je(this.pattern)}" enterkeyhint="${je(this.enterkeyhint)}" inputmode="${je(this.inputmode)}" @change="${this.onChange}" @input="${this.onInput}" @invalid="${this.onInvalid}" @keydown="${this.onKeyDown}">`}renderTextArea(e){return Z`<textarea ${De(this.inputRef)} part="input" class="input ${bt({"hide-input":e})}" name="${je(this.name)}" .value="${Sn(this.value)}" placeholder="${je(!this.label||this.isFocusedStyle||this.hasValue?this.placeholder:void 0)}" ?readonly="${this.readonly}" ?disabled="${this.disabled}" ?required="${this.required}" minlength="${je(this.minlength)}" maxlength="${je(this.maxlength)}" rows="${this.rows??1}" autocapitalize="${je(this.autocapitalize)}" autocorrect="${je(this.autocorrect)}" spellcheck="${je(this.spellcheck)}" enterkeyhint="${je(this.enterkeyhint)}" inputmode="${je(this.inputmode)}" @change="${this.onChange}" @input="${this.onInput}" @invalid="${this.onInvalid}" @keydown="${this.onKeyDown}" @keyup="${this.onTextAreaKeyUp}"></textarea>`}renderHelper(e,t){return e?Z`<div part="error" class="error">${this.error||this.inputRef.value.validationMessage}</div>`:t?Z`<slot name="helper" part="helper" class="helper">${this.helper}</slot>`:Z`<span></span>`}renderCounter(e){return e?Z`<div part="counter" class="counter">${this.value.length}/${this.maxlength}</div>`:Qe}};Ne.styles=[qe,v_];w([L({reflect:!0})],Ne.prototype,"variant",void 0);w([L({reflect:!0})],Ne.prototype,"type",void 0);w([L({reflect:!0})],Ne.prototype,"name",void 0);w([L()],Ne.prototype,"value",void 0);w([Ir()],Ne.prototype,"defaultValue",void 0);w([L({reflect:!0})],Ne.prototype,"label",void 0);w([L({reflect:!0})],Ne.prototype,"placeholder",void 0);w([L({reflect:!0})],Ne.prototype,"helper",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"helper-on-focus"})],Ne.prototype,"helperOnFocus",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ne.prototype,"clearable",void 0);w([L({reflect:!0,attribute:"clear-icon"})],Ne.prototype,"clearIcon",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"end-aligned"})],Ne.prototype,"endAligned",void 0);w([L({reflect:!0})],Ne.prototype,"prefix",void 0);w([L({reflect:!0})],Ne.prototype,"suffix",void 0);w([L({reflect:!0})],Ne.prototype,"icon",void 0);w([L({reflect:!0,attribute:"end-icon"})],Ne.prototype,"endIcon",void 0);w([L({reflect:!0,attribute:"error-icon"})],Ne.prototype,"errorIcon",void 0);w([L({reflect:!0})],Ne.prototype,"form",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ne.prototype,"readonly",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ne.prototype,"disabled",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ne.prototype,"required",void 0);w([L({type:Number,reflect:!0})],Ne.prototype,"rows",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ne.prototype,"autosize",void 0);w([L({type:Number,reflect:!0,attribute:"min-rows"})],Ne.prototype,"minRows",void 0);w([L({type:Number,reflect:!0,attribute:"max-rows"})],Ne.prototype,"maxRows",void 0);w([L({type:Number,reflect:!0})],Ne.prototype,"minlength",void 0);w([L({type:Number,reflect:!0})],Ne.prototype,"maxlength",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ne.prototype,"counter",void 0);w([L({type:Number,reflect:!0})],Ne.prototype,"min",void 0);w([L({type:Number,reflect:!0})],Ne.prototype,"max",void 0);w([L({type:Number,reflect:!0})],Ne.prototype,"step",void 0);w([L({reflect:!0})],Ne.prototype,"pattern",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"toggle-password"})],Ne.prototype,"togglePassword",void 0);w([L({reflect:!0,attribute:"show-password-icon"})],Ne.prototype,"showPasswordIcon",void 0);w([L({reflect:!0,attribute:"hide-password-icon"})],Ne.prototype,"hidePasswordIcon",void 0);w([L({reflect:!0})],Ne.prototype,"autocapitalize",void 0);w([L({reflect:!0})],Ne.prototype,"autocorrect",void 0);w([L({reflect:!0})],Ne.prototype,"autocomplete",void 0);w([L({reflect:!0})],Ne.prototype,"enterkeyhint",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ne.prototype,"spellcheck",void 0);w([L({reflect:!0})],Ne.prototype,"inputmode",void 0);w([Be()],Ne.prototype,"invalid",void 0);w([Be()],Ne.prototype,"invalidStyle",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"focused-style"})],Ne.prototype,"focusedStyle",void 0);w([Be()],Ne.prototype,"isPasswordVisible",void 0);w([Be()],Ne.prototype,"hasValue",void 0);w([Be()],Ne.prototype,"error",void 0);w([Re("disabled",!0)],Ne.prototype,"onDisabledChange",null);w([Re("value")],Ne.prototype,"onValueChange",null);w([Re("rows",!0)],Ne.prototype,"onRowsChange",null);w([Re("maxRows")],Ne.prototype,"onMaxRowsChange",null);w([Re("minRows")],Ne.prototype,"onMinRowsChange",null);Ne=w([Ae("mdui-text-field")],Ne);const w_=$e`: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 ot=class extends bi(Ke){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=Me(),this.textFieldRef=Me(),this.hiddenInputRef=Me(),this.formController=new lr(this),this.hasSlotController=new $t(this,"icon","end-icon","error-icon","prefix","suffix","clear-button","clear-icon","helper"),this.definedController=new At(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&&wt(this.value)?this.value?[this.value]:[]:this.value,this.defaultValue=this.multiple?[]:"",this.definedController.whenDefined().then(()=>{this.requestUpdate()}),this.updateComplete.then(()=>{this.observeResize=kr(this.textFieldRef.value,()=>this.resizeMenu())})}disconnectedCallback(){super.disconnectedCallback(),this.observeResize?.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(){const e=this.multiple?!!this.value.length:!!this.value;return Z`${this.multiple?Z`<select ${De(this.hiddenInputRef)} class="hidden-input" name="${je(this.name)}" value="${je(this.value)}" .required="${this.required}" .disabled="${this.disabled}" multiple="multiple" tabindex="-1">${hn(this.value,t=>Z`<option selected="selected" value="${t}"></option>`)}</select>`:Z`<input ${De(this.hiddenInputRef)} type="radio" class="hidden-input" name="${je(this.name)}" value="${je(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 ${De(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(t=>`${t}:text-field__${t}`).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="${this.hiddenInputRef.value?.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="${t=>t.stopPropagation()}" @keydown="${this.onTextFieldKeyDown}">${hn(["icon","end-icon","error-icon","prefix","suffix","clear-button","clear-icon","helper"],t=>this.hasSlotController.test(t)?Z`<slot name="${t}" slot="${t}"></slot>`:it)} ${at(this.multiple&&this.value.length,()=>Z`<div slot="input" class="chips" part="chips">${hn(this.value,t=>Z`<mdui-chip class="chip" part="chip" exportparts="${["button","label","delete-icon"].map(r=>`${r}:chip__${r}`).join(",")}" variant="input" deletable tabindex="-1" @delete="${()=>this.onDeleteOneValue(t)}">${this.getMenuItemLabelByValue(t)}</mdui-chip>`)}</div>`)}</mdui-text-field><mdui-menu ${De(this.menuRef)} part="menu" .selects="${this.multiple?"multiple":"single"}" .value="${this.value}" @change="${this.onValueChange}"><slot></slot></mdui-menu></mdui-dropdown>`}getMenuItemLabelByValue(e){return this.menuItems.length&&this.menuItems.find(t=>t.value===e)?.textContent?.trim()||e}resizeMenu(){this.menuRef.value.style.width=`${this.textFieldRef.value.clientWidth}px`}async onDropdownOpen(){this.textFieldRef.value.focusedStyle=!0}onDropdownClose(){this.textFieldRef.value.focusedStyle=!1,(this.contains(document.activeElement)||this.contains(document.activeElement?.assignedSlot??null))&&setTimeout(()=>{this.focus()})}async onValueChange(e){const t=e.target;this.value=this.multiple?t.value.map(n=>n??""):t.value??"",await this.updateComplete;const r=this.formController.getForm();r&&xt.get(r)?.has(this)?(this.invalid=!1,xt.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())}};ot.styles=[qe,w_];w([L({reflect:!0})],ot.prototype,"variant",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ot.prototype,"multiple",void 0);w([L({reflect:!0})],ot.prototype,"name",void 0);w([L()],ot.prototype,"value",void 0);w([Ir()],ot.prototype,"defaultValue",void 0);w([L({reflect:!0})],ot.prototype,"label",void 0);w([L({reflect:!0})],ot.prototype,"placeholder",void 0);w([L({reflect:!0})],ot.prototype,"helper",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ot.prototype,"clearable",void 0);w([L({reflect:!0,attribute:"clear-icon"})],ot.prototype,"clearIcon",void 0);w([L({reflect:!0})],ot.prototype,"placement",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"end-aligned"})],ot.prototype,"endAligned",void 0);w([L({reflect:!0})],ot.prototype,"prefix",void 0);w([L({reflect:!0})],ot.prototype,"suffix",void 0);w([L({reflect:!0})],ot.prototype,"icon",void 0);w([L({reflect:!0,attribute:"end-icon"})],ot.prototype,"endIcon",void 0);w([L({reflect:!0,attribute:"error-icon"})],ot.prototype,"errorIcon",void 0);w([L({reflect:!0})],ot.prototype,"form",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ot.prototype,"readonly",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ot.prototype,"disabled",void 0);w([L({type:Boolean,reflect:!0,converter:we})],ot.prototype,"required",void 0);w([Be()],ot.prototype,"invalid",void 0);w([gi({flatten:!0,selector:"mdui-menu-item"})],ot.prototype,"menuItems",void 0);ot=w([Ae("mdui-select")],ot);const __=$e`.track-active{left:-.125rem;border-radius:var(--mdui-shape-corner-full) 0 0 var(--mdui-shape-corner-full)}`;let Tn=class extends Pt{constructor(){super(...arguments),this.value=0,this.defaultValue=0,this.rippleRef=Me(),this.handleRef=Me(),this.formController=new lr(this)}get rippleElement(){return this.rippleRef.value}async onValueChange(){this.value=this.fixValue(this.value);const e=this.formController.getForm();e&&xt.get(e)?.has(this)?(this.invalid=!1,xt.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 Z`<label class="${bt({invalid:this.invalid})}"><input ${De(this.inputRef)} type="range" step="${this.step}" min="${this.min}" max="${this.max}" ?disabled="${this.disabled}" .value="${Sn(this.value.toString())}" @input="${this.onInput}" @change="${this.onChange}"><div part="track-inactive" class="track-inactive"></div><div ${De(this.trackActiveRef)} part="track-active" class="track-active"></div><div ${De(this.handleRef)} part="handle" class="handle"><div class="elevation"></div><mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.renderLabel(this.value)}</div>${at(this.tickmarks,()=>hn(this.getCandidateValues(),e=>Z`<div part="tickmark" class="tickmark ${bt({active:e<this.value})}" style="${jr({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()}};Tn.styles=[Pt.styles,__];w([L({type:Number})],Tn.prototype,"value",void 0);w([Ir()],Tn.prototype,"defaultValue",void 0);w([Re("value",!0)],Tn.prototype,"onValueChange",null);Tn=w([Ae("mdui-slider")],Tn);const x_=$e`: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}`,Oi=[];let Xl=!1,Gt=class extends Ke{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=ti(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([Zt(this),...t.map(s=>Zt(s))]),Oi.push({height:this.clientHeight,snackbar:this}),await this.reorderStack(this);const n=$i(this,"medium4");await Promise.all([st(this,[{opacity:0},{opacity:1,offset:.5},{opacity:1}],{duration:r?n:0,easing:e,fill:"forwards"}),...t.map(s=>st(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([Zt(this),...t.map(o=>Zt(o))]);const n=$i(this,"short4");await Promise.all([st(this,[{opacity:1},{opacity:0}],{duration:n,easing:e,fill:"forwards"}),...t.map(o=>st(o,[{opacity:1},{opacity:0,offset:.75},{opacity:0}],{duration:n,easing:e}))]),this.style.display="none",this.emit("closed");const s=Oi.findIndex(o=>o.snackbar===this);Oi.splice(s,1),Oi[s]&&await this.reorderStack(Oi[s].snackbar);return}}async onStackChange(){await this.reorderStack(this)}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this.onDocumentClick),this.mobile=xc().down("sm"),this.observeResize=kr(document.documentElement,async()=>{const e=xc().down("sm");this.mobile!==e&&(this.mobile=e,Xl||(Xl=!0,await this.reorderStack(),Xl=!1))})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentClick),window.clearTimeout(this.closeTimeout),this.open&&(this.open=!1),this.observeResize?.unobserve()}render(){return Z`<slot part="message" class="message"></slot><div class="action-group"><slot name="action" part="action" class="action" @click="${this.onActionClick}">${this.action?Z`<mdui-button variant="text" loading="${this.actionLoading}">${this.action}</mdui-button>`:Qe}</slot>${at(this.closeable,()=>Z`<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?Z`<mdui-icon name="${this.closeIcon}" class="i"></mdui-icon>`:Z`<mdui-icon-clear class="i"></mdui-icon-clear>`}</slot></mdui-button-icon></slot>`)}</div>`}async reorderStack(e){const t=e?Oi.findIndex(r=>r.snackbar===e):0;for(let r=t;r<Oi.length;r++){const s=Oi[r].snackbar;this.mobile?["top","bottom"].forEach(o=>{if(s.placement.startsWith(o)){const a=Oi.filter((l,d)=>d<r&&l.snackbar.placement.startsWith(o)),c=a.reduce((l,d)=>l+d.height,0);s.style[o]=`calc(${c}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=Oi.filter((l,d)=>d<r&&l.snackbar.placement===o),c=a.reduce((l,d)=>l+d.height,0);s.style[o.startsWith("top")?"top":"bottom"]=`calc(${c}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}};Gt.styles=[qe,x_];w([L({type:Boolean,reflect:!0,converter:we})],Gt.prototype,"open",void 0);w([L({reflect:!0})],Gt.prototype,"placement",void 0);w([L({reflect:!0,attribute:"action"})],Gt.prototype,"action",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"action-loading"})],Gt.prototype,"actionLoading",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Gt.prototype,"closeable",void 0);w([L({reflect:!0,attribute:"close-icon"})],Gt.prototype,"closeIcon",void 0);w([L({type:Number,reflect:!0,attribute:"message-line"})],Gt.prototype,"messageLine",void 0);w([L({type:Number,reflect:!0,attribute:"auto-close-delay"})],Gt.prototype,"autoCloseDelay",void 0);w([L({type:Boolean,reflect:!0,attribute:"close-on-outside-click",converter:we})],Gt.prototype,"closeOnOutsideClick",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Gt.prototype,"mobile",void 0);w([Re("open")],Gt.prototype,"onOpenChange",null);w([Re("placement",!0),Re("messageLine",!0)],Gt.prototype,"onStackChange",null);Gt=w([Ae("mdui-snackbar")],Gt);const E_=$e`: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 Kt=class extends Di(bi(Ke)){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=Me(),this.inputRef=Me(),this.formController=new lr(this,{value:e=>e.checked?e.value:void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.hasSlotController=new $t(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(){await this.updateComplete;const e=this.formController.getForm();e&&xt.get(e)?.has(this)?(this.invalid=!1,xt.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 Z`<label class="${bt({invalid:this.invalid,"has-unchecked-icon":this.uncheckedIcon||this.hasSlotController.test("unchecked-icon")})}"><input ${De(this.inputRef)} type="checkbox" name="${je(this.name)}" value="${je(this.value)}" .disabled="${this.disabled}" .checked="${Sn(this.checked)}" .required="${this.required}" @change="${this.onChange}"><div part="track" class="track"><div part="thumb" class="thumb"><mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><slot name="checked-icon" part="checked-icon" class="checked-icon">${this.checkedIcon?Z`<mdui-icon name="${this.checkedIcon}" class="i"></mdui-icon>`:this.checkedIcon===""?Qe:Z`<mdui-icon-check class="i"></mdui-icon-check>`}</slot><slot name="unchecked-icon" part="unchecked-icon" class="unchecked-icon">${this.uncheckedIcon?Z`<mdui-icon name="${this.uncheckedIcon}" class="i"></mdui-icon>`:Qe}</slot></div></div></label>`}onChange(){this.checked=this.inputRef.value.checked,this.emit("change")}};Kt.styles=[qe,E_];w([L({type:Boolean,reflect:!0,converter:we})],Kt.prototype,"disabled",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Kt.prototype,"checked",void 0);w([Ir("checked")],Kt.prototype,"defaultChecked",void 0);w([L({reflect:!0,attribute:"unchecked-icon"})],Kt.prototype,"uncheckedIcon",void 0);w([L({reflect:!0,attribute:"checked-icon"})],Kt.prototype,"checkedIcon",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Kt.prototype,"required",void 0);w([L({reflect:!0})],Kt.prototype,"form",void 0);w([L({reflect:!0})],Kt.prototype,"name",void 0);w([L({reflect:!0})],Kt.prototype,"value",void 0);w([Be()],Kt.prototype,"invalid",void 0);w([Re("disabled",!0),Re("required",!0)],Kt.prototype,"onDisabledChange",null);w([Re("checked",!0)],Kt.prototype,"onCheckedChange",null);Kt=w([Ae("mdui-switch")],Kt);const S_=$e`: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 wr=class extends Di(bi(Ke)){constructor(){super(...arguments),this.inline=!1,this.active=!1,this.variant="primary",this.key=Sr(),this.rippleRef=Me(),this.hasSlotController=new $t(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=()=>Z`<slot name="badge"></slot>`;return Z`<mdui-ripple ${De(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><div part="container" class="${bt({container:!0,preset:!t,"variant-secondary":this.variant==="secondary"})}"><slot name="custom"><div class="icon-container">${at(e||this.icon,r)}<slot name="icon" part="icon" class="icon">${this.icon?Z`<mdui-icon name="${this.icon}"></mdui-icon>`:Qe}</slot></div><div class="label-container">${at(!e,r)}<slot part="label" class="label"></slot></div></slot></div>`}};wr.styles=[qe,S_];w([L({reflect:!0})],wr.prototype,"value",void 0);w([L({reflect:!0})],wr.prototype,"icon",void 0);w([L({type:Boolean,reflect:!0,converter:we})],wr.prototype,"inline",void 0);w([L({type:Boolean,reflect:!0,converter:we})],wr.prototype,"active",void 0);w([Be()],wr.prototype,"variant",void 0);wr=w([Ae("mdui-tab")],wr);const k_=$e`:host{display:block;overflow-y:auto;flex:1 1 auto}:host(:not([active])){display:none}`;let Os=class extends Ke{constructor(){super(...arguments),this.active=!1}render(){return Z`<slot></slot>`}};Os.styles=[qe,k_];w([L({reflect:!0})],Os.prototype,"value",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Os.prototype,"active",void 0);Os=w([Ae("mdui-tab-panel")],Os);const R_=$e`: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 si=class extends Ke{constructor(){super(...arguments),this.variant="primary",this.placement="top-start",this.fullWidth=!1,this.activeKey=0,this.isInitial=!0,this.containerRef=Me(),this.indicatorRef=Me(),this.definedController=new At(this,{relatedElements:["mdui-tab","mdui-tab-panel"]})}async onActiveKeyChange(){await this.definedController.whenDefined(),this.value=this.tabs.find(e=>e.key===this.activeKey)?.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?.key??0}async onIndicatorChange(){await this.updateComplete,this.updateIndicator()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.observeResize=kr(this.containerRef.value,()=>this.updateIndicator())})}disconnectedCallback(){super.disconnectedCallback(),this.observeResize?.unobserve()}render(){return Z`<div ${De(this.containerRef)} part="container" class="container ${bt({initial:this.isInitial})}"><slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot><div ${De(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=>e.active=e.value===this.activeTab?.value),this.updateIndicator()}updateIndicator(){const e=this.activeTab,t=oe(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=oe(e),s=e.offsetTop,o=e.offsetLeft,a=r?{transform:"scaleY(1)",width:"",left:""}:{transform:"scaleX(1)",height:"",top:""};let c={};if(this.variant==="primary"){const l=n.find(':scope > [slot="custom"]'),d=l.length?l.get():oe(e.renderRoot).find('slot[name="custom"]').children().get();if(r){const u=Math.min(...d.map(g=>g.offsetTop))+s,p=Math.max(...d.map(g=>g.offsetTop+g.offsetHeight))+s;c={top:u,height:p-u}}else{const u=Math.min(...d.map(g=>g.offsetLeft))+o,p=Math.max(...d.map(g=>g.offsetLeft+g.offsetWidth))+o;c={left:u,width:p-u}}}this.variant==="secondary"&&(c=r?{top:s,height:e.offsetHeight}:{left:o,width:e.offsetWidth}),t.css({...a,...c})}};si.styles=[qe,R_];w([L({reflect:!0})],si.prototype,"variant",void 0);w([L({reflect:!0})],si.prototype,"value",void 0);w([L({reflect:!0})],si.prototype,"placement",void 0);w([L({type:Boolean,reflect:!0,converter:we,attribute:"full-width"})],si.prototype,"fullWidth",void 0);w([Be()],si.prototype,"activeKey",void 0);w([Be()],si.prototype,"isInitial",void 0);w([gi({selector:"mdui-tab",flatten:!0})],si.prototype,"tabs",void 0);w([gi({selector:"mdui-tab-panel",slot:"panel",flatten:!0})],si.prototype,"panels",void 0);w([Re("activeKey",!0)],si.prototype,"onActiveKeyChange",null);w([Re("value")],si.prototype,"onValueChange",null);w([Re("variant",!0),Re("placement",!0),Re("fullWidth",!0)],si.prototype,"onIndicatorChange",null);si=w([Ae("mdui-tabs")],si);class I_{constructor(e,t){this.isHover=!1,this.uniqueID=Sr(),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(()=>{oe(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(){oe(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 T_=$e`: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 oi=class extends Ke{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=Me(),this.hasSlotController=new $t(this,"headline","action"),this.hoverController=new I_(this,this.popupRef),this.definedController=new At(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=$i(this,"short4"),r=ti(this,"standard");if(this.open){if(await this.definedController.whenDefined(),oe(`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 Zt(this.popupRef.value),this.popupRef.value.hidden=!1,this.updatePositioner(),await st(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 Zt(this.popupRef.value),await st(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=Lo(this.target),this.overflowAncestors.forEach(e=>{e.addEventListener("scroll",this.onWindowScroll)}),this.observeResize=kr(this.target,()=>{this.updatePositioner()})})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentClick),this.overflowAncestors?.forEach(e=>{e.removeEventListener("scroll",this.onWindowScroll)}),this.observeResize?.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 Z`<slot></slot><div ${De(this.popupRef)} part="popup" class="popup" hidden>${at(e,()=>Z`<slot name="headline" part="headline" class="headline">${this.headline}</slot>`)}<slot name="content" part="content" class="content">${this.content}</slot>${at(t,()=>Z`<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=oe(this.popupRef.value),t=this.isRich()?0:4,r=4,n=this.target.getBoundingClientRect(),s=n.top,o=n.left,a=n.height,c=n.width,l=this.popupRef.value.offsetHeight,d=this.popupRef.value.offsetWidth,u=d+t+r,p=l+t+r;let g,v,_,E,x=this.placement;if(x==="auto"){const h=oe(window),m=s>p,T=h.height()-s-a>p,N=o>u,C=h.width()-o-c>u;this.isRich()?(x="bottom-right",T&&C?x="bottom-right":T&&N?x="bottom-left":m&&C?x="top-right":m&&N?x="top-left":T?x="bottom":m?x="top":C?x="right":N&&(x="left")):(x="top",m?x="top":T?x="bottom":N?x="left":C&&(x="right"))}const[k,y]=x.split("-");switch(k){case"top":v="bottom",_=s-l-t;break;case"bottom":v="top",_=s+a+t;break;default:switch(v="center",y){case"start":_=s;break;case"end":_=s+a-l;break;default:_=s+a/2-l/2;break}break}switch(k){case"left":g="right",E=o-d-t;break;case"right":g="left",E=o+c+t;break;default:switch(g="center",y){case"start":E=o;break;case"end":E=o+c-d;break;case"left":g="right",E=o-d-t;break;case"right":g="left",E=o+c+t;break;default:E=o+c/2-d/2;break}break}e.css({top:_,left:E,transformOrigin:[g,v].join(" ")})}};oi.styles=[qe,T_];w([L({reflect:!0})],oi.prototype,"variant",void 0);w([L({reflect:!0})],oi.prototype,"placement",void 0);w([L({type:Number,reflect:!0,attribute:"open-delay"})],oi.prototype,"openDelay",void 0);w([L({type:Number,reflect:!0,attribute:"close-delay"})],oi.prototype,"closeDelay",void 0);w([L({reflect:!0})],oi.prototype,"headline",void 0);w([L({reflect:!0})],oi.prototype,"content",void 0);w([L({reflect:!0})],oi.prototype,"trigger",void 0);w([L({type:Boolean,reflect:!0,converter:we})],oi.prototype,"disabled",void 0);w([L({type:Boolean,reflect:!0,converter:we})],oi.prototype,"open",void 0);w([Re("placement",!0),Re("content",!0)],oi.prototype,"onPositionChange",null);w([Re("open")],oi.prototype,"onOpenChange",null);oi=w([Ae("mdui-tooltip")],oi);const C_=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},$_=$e`: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 Ps=class extends Ke{constructor(){super(...arguments),this.variant="small",this.shrink=!1,this.hasSlotController=new $t(this,"label-large"),this.labelLargeRef=Me(),this.defaultSlotRef=Me()}render(){const e=this.hasSlotController.test("label-large"),t=bt({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 Z`<slot part="label" class="label ${t}" ${De(this.defaultSlotRef)} @slotchange="${()=>this.onSlotChange(e)}"></slot>${e?Z`<slot name="label-large" part="label-large" class="label-large ${t}"></slot>`:Z`<div ${De(this.labelLargeRef)} part="label-large" class="label-large ${t}"></div>`}`}onSlotChange(e){e||(this.labelLargeRef.value.innerHTML=C_(this.defaultSlotRef.value))}};Ps.styles=[qe,$_];w([Be()],Ps.prototype,"variant",void 0);w([Be()],Ps.prototype,"shrink",void 0);Ps=w([Ae("mdui-top-app-bar-title")],Ps);const A_=$e`: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 Ai=class extends Ed(Rr){constructor(){super(...arguments),this.variant="small",this.hide=!1,this.shrink=!1,this.scrolling=!1,this.definedController=new At(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 Z`<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))}};Ai.styles=[qe,A_];w([L({reflect:!0})],Ai.prototype,"variant",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ai.prototype,"hide",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ai.prototype,"shrink",void 0);w([L({reflect:!0,attribute:"scroll-behavior"})],Ai.prototype,"scrollBehavior",void 0);w([L({type:Boolean,reflect:!0,converter:we})],Ai.prototype,"scrolling",void 0);w([gi({selector:"mdui-top-app-bar-title",flatten:!0})],Ai.prototype,"titleElements",void 0);w([Re("variant")],Ai.prototype,"onVariantChange",null);w([Re("shrink")],Ai.prototype,"onShrinkChange",null);Ai=w([Ae("mdui-top-app-bar")],Ai);/**
468
493
  * @license
469
494
  * Copyright 2021 Google LLC
470
495
  *
@@ -479,7 +504,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
479
504
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
480
505
  * See the License for the specific language governing permissions and
481
506
  * limitations under the License.
482
- */function Ft(i){return i<0?-1:i===0?0:1}function Zn(i,e,t){return(1-t)*i+t*e}function U1(i,e,t){return t<i?i:t>e?e:t}function no(i,e,t){return t<i?i:t>e?e:t}function V1(i){return i=i%360,i<0&&(i=i+360),i}function tc(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]}/**
507
+ */function Yt(i){return i<0?-1:i===0?0:1}function ks(i,e,t){return(1-t)*i+t*e}function N_(i,e,t){return t<i?i:t>e?e:t}function Po(i,e,t){return t<i?i:t>e?e:t}function D_(i){return i=i%360,i<0&&(i=i+360),i}function Cc(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]}/**
483
508
  * @license
484
509
  * Copyright 2021 Google LLC
485
510
  *
@@ -494,7 +519,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
494
519
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
495
520
  * See the License for the specific language governing permissions and
496
521
  * limitations under the License.
497
- */const z1=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],H1=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],W1=[95.047,100,108.883];function Yc(i,e,t){return(255<<24|(i&255)<<16|(e&255)<<8|t&255)>>>0}function tf(i){const e=_r(i[0]),t=_r(i[1]),r=_r(i[2]);return Yc(e,t,r)}function G1(i){return i>>16&255}function K1(i){return i>>8&255}function J1(i){return i&255}function Q1(i,e,t){const r=H1,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=_r(n),l=_r(s),c=_r(o);return Yc(a,l,c)}function X1(i){const e=Vr(G1(i)),t=Vr(K1(i)),r=Vr(J1(i));return tc([e,t,r],z1)}function Y1(i){const e=er(i),t=_r(e);return Yc(t,t,t)}function rf(i){const e=X1(i)[1];return 116*Vp(e/100)-16}function er(i){return 100*e_((i+16)/116)}function ic(i){return Vp(i/100)*116-16}function Vr(i){const e=i/255;return e<=.040449936?e/12.92*100:Math.pow((e+.055)/1.055,2.4)*100}function _r(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,U1(0,255,Math.round(t*255))}function Z1(){return W1}function Vp(i){const e=.008856451679035631,t=24389/27;return i>e?Math.pow(i,1/3):(t*i+16)/116}function e_(i){const e=.008856451679035631,t=24389/27,r=i*i*i;return r>e?r:(116*i-16)/t}/**
522
+ */const L_=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],O_=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],P_=[95.047,100,108.883];function Rd(i,e,t){return(255<<24|(i&255)<<16|(e&255)<<8|t&255)>>>0}function Pf(i){const e=Br(i[0]),t=Br(i[1]),r=Br(i[2]);return Rd(e,t,r)}function M_(i){return i>>16&255}function F_(i){return i>>8&255}function j_(i){return i&255}function B_(i,e,t){const r=O_,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=Br(n),c=Br(s),l=Br(o);return Rd(a,c,l)}function q_(i){const e=fn(M_(i)),t=fn(F_(i)),r=fn(j_(i));return Cc([e,t,r],L_)}function U_(i){const e=gr(i),t=Br(e);return Rd(t,t,t)}function Mf(i){const e=q_(i)[1];return 116*Rm(e/100)-16}function gr(i){return 100*z_((i+16)/116)}function $c(i){return Rm(i/100)*116-16}function fn(i){const e=i/255;return e<=.040449936?e/12.92*100:Math.pow((e+.055)/1.055,2.4)*100}function Br(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,N_(0,255,Math.round(t*255))}function V_(){return P_}function Rm(i){const e=.008856451679035631,t=24389/27;return i>e?Math.pow(i,1/3):(t*i+16)/116}function z_(i){const e=.008856451679035631,t=24389/27,r=i*i*i;return r>e?r:(116*i-16)/t}/**
498
523
  * @license
499
524
  * Copyright 2021 Google LLC
500
525
  *
@@ -509,7 +534,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
509
534
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
510
535
  * See the License for the specific language governing permissions and
511
536
  * limitations under the License.
512
- */class Ri{static make(e=Z1(),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?Zn(.59,.69,(d-.9)*10):Zn(.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 Ri(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}}Ri.DEFAULT=Ri.make();/**
537
+ */class ji{static make(e=V_(),t=200/Math.PI*gr(50)/100,r=50,n=2,s=!1){const o=e,a=o[0]*.401288+o[1]*.650173+o[2]*-.051461,c=o[0]*-.250268+o[1]*1.204414+o[2]*.045854,l=o[0]*-.002079+o[1]*.048952+o[2]*.953127,d=.8+n/10,u=d>=.9?ks(.59,.69,(d-.9)*10):ks(.525,.59,(d-.8)*10);let p=s?1:d*(1-1/3.6*Math.exp((-t-42)/92));p=p>1?1:p<0?0:p;const g=d,v=[p*(100/a)+1-p,p*(100/c)+1-p,p*(100/l)+1-p],_=1/(5*t+1),E=_*_*_*_,x=1-E,k=E*t+.1*x*x*Math.cbrt(5*t),y=gr(r)/e[1],h=1.48+Math.sqrt(y),m=.725/Math.pow(y,.2),T=m,N=[Math.pow(k*v[0]*a/100,.42),Math.pow(k*v[1]*c/100,.42),Math.pow(k*v[2]*l/100,.42)],C=[400*N[0]/(N[0]+27.13),400*N[1]/(N[1]+27.13),400*N[2]/(N[2]+27.13)],F=(2*C[0]+C[1]+.05*C[2])*m;return new ji(y,F,m,T,u,g,v,k,Math.pow(k,.25),h)}constructor(e,t,r,n,s,o,a,c,l,d){this.n=e,this.aw=t,this.nbb=r,this.ncb=n,this.c=s,this.nc=o,this.rgbD=a,this.fl=c,this.fLRoot=l,this.z=d}}ji.DEFAULT=ji.make();/**
513
538
  * @license
514
539
  * Copyright 2021 Google LLC
515
540
  *
@@ -524,7 +549,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
524
549
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
525
550
  * See the License for the specific language governing permissions and
526
551
  * limitations under the License.
527
- */class Qt{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 Qt.fromIntInViewingConditions(e,Ri.DEFAULT)}static fromIntInViewingConditions(e,t){const r=(e&16711680)>>16,n=(e&65280)>>8,s=e&255,o=Vr(r),a=Vr(n),l=Vr(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,X=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(X),ne=V*Math.sin(X);return new Qt(L,ce,Y,F,H,W,K,re,ne)}static fromJch(e,t,r){return Qt.fromJchInViewingConditions(e,t,r,Ri.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 Qt(r,t,e,s,o,l,d,g,y)}static fromUcs(e,t,r){return Qt.fromUcsInViewingConditions(e,t,r,Ri.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 Qt.fromJchInViewingConditions(f,c,d,n)}toInt(){return this.viewed(Ri.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 Q1(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),X=5e4/13*I*n.nc*n.ncb*Math.sqrt(S*S+k*k)/(v+.305),A=Math.pow(X,.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 Qt(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]}}/**
552
+ */class li{constructor(e,t,r,n,s,o,a,c,l){this.hue=e,this.chroma=t,this.j=r,this.q=n,this.m=s,this.s=o,this.jstar=a,this.astar=c,this.bstar=l}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 li.fromIntInViewingConditions(e,ji.DEFAULT)}static fromIntInViewingConditions(e,t){const r=(e&16711680)>>16,n=(e&65280)>>8,s=e&255,o=fn(r),a=fn(n),c=fn(s),l=.41233895*o+.35762064*a+.18051042*c,d=.2126*o+.7152*a+.0722*c,u=.01932141*o+.11916382*a+.95034478*c,p=.401288*l+.650173*d-.051461*u,g=-.250268*l+1.204414*d+.045854*u,v=-.002079*l+.048952*d+.953127*u,_=t.rgbD[0]*p,E=t.rgbD[1]*g,x=t.rgbD[2]*v,k=Math.pow(t.fl*Math.abs(_)/100,.42),y=Math.pow(t.fl*Math.abs(E)/100,.42),h=Math.pow(t.fl*Math.abs(x)/100,.42),m=Yt(_)*400*k/(k+27.13),T=Yt(E)*400*y/(y+27.13),N=Yt(x)*400*h/(h+27.13),C=(11*m+-12*T+N)/11,F=(m+T-2*N)/9,I=(20*m+20*T+21*N)/20,O=(40*m+20*T+N)/20,R=Math.atan2(F,C)*180/Math.PI,D=R<0?R+360:R>=360?R-360:R,Q=D*Math.PI/180,$=O*t.nbb,Y=100*Math.pow($/t.aw,t.c*t.z),B=4/t.c*Math.sqrt(Y/100)*(t.aw+4)*t.fLRoot,re=D<20.14?D+360:D,S=.25*(Math.cos(re*Math.PI/180+2)+3.8),ee=5e4/13*S*t.nc*t.ncb*Math.sqrt(C*C+F*F)/(I+.305),J=Math.pow(ee,.9)*Math.pow(1.64-Math.pow(.29,t.n),.73),he=J*Math.sqrt(Y/100),W=he*t.fLRoot,G=50*Math.sqrt(J*t.c/(t.aw+4)),X=(1+100*.007)*Y/(1+.007*Y),z=1/.0228*Math.log(1+.0228*W),ne=z*Math.cos(Q),se=z*Math.sin(Q);return new li(D,he,Y,B,W,G,X,ne,se)}static fromJch(e,t,r){return li.fromJchInViewingConditions(e,t,r,ji.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),c=50*Math.sqrt(a*n.c/(n.aw+4)),l=r*Math.PI/180,d=(1+100*.007)*e/(1+.007*e),u=1/.0228*Math.log(1+.0228*o),p=u*Math.cos(l),g=u*Math.sin(l);return new li(r,t,e,s,o,c,d,p,g)}static fromUcs(e,t,r){return li.fromUcsInViewingConditions(e,t,r,ji.DEFAULT)}static fromUcsInViewingConditions(e,t,r,n){const s=t,o=r,a=Math.sqrt(s*s+o*o),l=(Math.exp(a*.0228)-1)/.0228/n.fLRoot;let d=Math.atan2(o,s)*(180/Math.PI);d<0&&(d+=360);const u=e/(1-(e-100)*.007);return li.fromJchInViewingConditions(u,l,d,n)}toInt(){return this.viewed(ji.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,c=o/e.nbb,l=Math.sin(n),d=Math.cos(n),u=23*(c+.305)*r/(23*a+11*r*d+108*r*l),p=u*d,g=u*l,v=(460*c+451*p+288*g)/1403,_=(460*c-891*p-261*g)/1403,E=(460*c-220*p-6300*g)/1403,x=Math.max(0,27.13*Math.abs(v)/(400-Math.abs(v))),k=Yt(v)*(100/e.fl)*Math.pow(x,1/.42),y=Math.max(0,27.13*Math.abs(_)/(400-Math.abs(_))),h=Yt(_)*(100/e.fl)*Math.pow(y,1/.42),m=Math.max(0,27.13*Math.abs(E)/(400-Math.abs(E))),T=Yt(E)*(100/e.fl)*Math.pow(m,1/.42),N=k/e.rgbD[0],C=h/e.rgbD[1],F=T/e.rgbD[2],I=1.86206786*N-1.01125463*C+.14918677*F,O=.38752654*N+.62144744*C-.00897398*F,U=-.0158415*N-.03412294*C+1.04996444*F;return B_(I,O,U)}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,c=n.rgbD[0]*s,l=n.rgbD[1]*o,d=n.rgbD[2]*a,u=Math.pow(n.fl*Math.abs(c)/100,.42),p=Math.pow(n.fl*Math.abs(l)/100,.42),g=Math.pow(n.fl*Math.abs(d)/100,.42),v=Yt(c)*400*u/(u+27.13),_=Yt(l)*400*p/(p+27.13),E=Yt(d)*400*g/(g+27.13),x=(11*v+-12*_+E)/11,k=(v+_-2*E)/9,y=(20*v+20*_+21*E)/20,h=(40*v+20*_+E)/20,T=Math.atan2(k,x)*180/Math.PI,N=T<0?T+360:T>=360?T-360:T,C=N*Math.PI/180,F=h*n.nbb,I=100*Math.pow(F/n.aw,n.c*n.z),O=4/n.c*Math.sqrt(I/100)*(n.aw+4)*n.fLRoot,U=N<20.14?N+360:N,R=1/4*(Math.cos(U*Math.PI/180+2)+3.8),Q=5e4/13*R*n.nc*n.ncb*Math.sqrt(x*x+k*k)/(y+.305),$=Math.pow(Q,.9)*Math.pow(1.64-Math.pow(.29,n.n),.73),Y=$*Math.sqrt(I/100),B=Y*n.fLRoot,re=50*Math.sqrt($*n.c/(n.aw+4)),S=(1+100*.007)*I/(1+.007*I),H=Math.log(1+.0228*B)/.0228,ee=H*Math.cos(C),J=H*Math.sin(C);return new li(N,Y,I,O,B,re,S,ee,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,c=o/e.nbb,l=Math.sin(n),d=Math.cos(n),u=23*(c+.305)*r/(23*a+11*r*d+108*r*l),p=u*d,g=u*l,v=(460*c+451*p+288*g)/1403,_=(460*c-891*p-261*g)/1403,E=(460*c-220*p-6300*g)/1403,x=Math.max(0,27.13*Math.abs(v)/(400-Math.abs(v))),k=Yt(v)*(100/e.fl)*Math.pow(x,1/.42),y=Math.max(0,27.13*Math.abs(_)/(400-Math.abs(_))),h=Yt(_)*(100/e.fl)*Math.pow(y,1/.42),m=Math.max(0,27.13*Math.abs(E)/(400-Math.abs(E))),T=Yt(E)*(100/e.fl)*Math.pow(m,1/.42),N=k/e.rgbD[0],C=h/e.rgbD[1],F=T/e.rgbD[2],I=1.86206786*N-1.01125463*C+.14918677*F,O=.38752654*N+.62144744*C-.00897398*F,U=-.0158415*N-.03412294*C+1.04996444*F;return[I,O,U]}}/**
528
553
  * @license
529
554
  * Copyright 2021 Google LLC
530
555
  *
@@ -539,7 +564,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
539
564
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
540
565
  * See the License for the specific language governing permissions and
541
566
  * limitations under the License.
542
- */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=tc(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=Ri.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=tc([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:tf(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 Y1(r);e=V1(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 tf(a)}static solveToCam(e,t,r){return Qt.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];/**
567
+ */class Le{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 Yt(e)*400*t/(t+27.13)}static hueOf(e){const t=Cc(e,Le.SCALED_DISCOUNT_FROM_LINRGB),r=Le.chromaticAdaptation(t[0]),n=Le.chromaticAdaptation(t[1]),s=Le.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=Le.sanitizeRadians(t-e),s=Le.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=Le.intercept(e[n],t,r[n]);return Le.lerpPoint(e,s,r)}static isBounded(e){return 0<=e&&e<=100}static nthVertex(e,t){const r=Le.Y_FROM_LINRGB[0],n=Le.Y_FROM_LINRGB[1],s=Le.Y_FROM_LINRGB[2],o=t%4<=1?0:100,a=t%2===0?0:100;if(t<4){const c=o,l=a,d=(e-c*n-l*s)/r;return Le.isBounded(d)?[d,c,l]:[-1,-1,-1]}else if(t<8){const c=o,l=a,d=(e-l*r-c*s)/n;return Le.isBounded(d)?[l,d,c]:[-1,-1,-1]}else{const c=o,l=a,d=(e-c*r-l*n)/s;return Le.isBounded(d)?[c,l,d]:[-1,-1,-1]}}static bisectToSegment(e,t){let r=[-1,-1,-1],n=r,s=0,o=0,a=!1,c=!0;for(let l=0;l<12;l++){const d=Le.nthVertex(e,l);if(d[0]<0)continue;const u=Le.hueOf(d);if(!a){r=d,n=d,s=u,o=u,a=!0;continue}(c||Le.areInCyclicOrder(s,u,o))&&(c=!1,Le.areInCyclicOrder(s,t,u)?(n=d,o=u):(r=d,s=u))}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=Le.bisectToSegment(e,t);let n=r[0],s=Le.hueOf(n),o=r[1];for(let a=0;a<3;a++)if(n[a]!==o[a]){let c=-1,l=255;n[a]<o[a]?(c=Le.criticalPlaneBelow(Le.trueDelinearized(n[a])),l=Le.criticalPlaneAbove(Le.trueDelinearized(o[a]))):(c=Le.criticalPlaneAbove(Le.trueDelinearized(n[a])),l=Le.criticalPlaneBelow(Le.trueDelinearized(o[a])));for(let d=0;d<8&&!(Math.abs(l-c)<=1);d++){const u=Math.floor((c+l)/2),p=Le.CRITICAL_PLANES[u],g=Le.setCoordinate(n,p,o,a),v=Le.hueOf(g);Le.areInCyclicOrder(s,t,v)?(o=g,l=u):(n=g,s=v,c=u)}}return Le.midpoint(n,o)}static inverseChromaticAdaptation(e){const t=Math.abs(e),r=Math.max(0,27.13*t/(400-t));return Yt(e)*Math.pow(r,1/.42)}static findResultByJ(e,t,r){let n=Math.sqrt(r)*11;const s=ji.DEFAULT,o=1/Math.pow(1.64-Math.pow(.29,s.n),.73),c=.25*(Math.cos(e+2)+3.8)*(5e4/13)*s.nc*s.ncb,l=Math.sin(e),d=Math.cos(e);for(let u=0;u<5;u++){const p=n/100,g=t===0||n===0?0:t/Math.sqrt(p),v=Math.pow(g*o,1/.9),E=s.aw*Math.pow(p,1/s.c/s.z)/s.nbb,x=23*(E+.305)*v/(23*c+11*v*d+108*v*l),k=x*d,y=x*l,h=(460*E+451*k+288*y)/1403,m=(460*E-891*k-261*y)/1403,T=(460*E-220*k-6300*y)/1403,N=Le.inverseChromaticAdaptation(h),C=Le.inverseChromaticAdaptation(m),F=Le.inverseChromaticAdaptation(T),I=Cc([N,C,F],Le.LINRGB_FROM_SCALED_DISCOUNT);if(I[0]<0||I[1]<0||I[2]<0)return 0;const O=Le.Y_FROM_LINRGB[0],U=Le.Y_FROM_LINRGB[1],R=Le.Y_FROM_LINRGB[2],D=O*I[0]+U*I[1]+R*I[2];if(D<=0)return 0;if(u===4||Math.abs(D-r)<.002)return I[0]>100.01||I[1]>100.01||I[2]>100.01?0:Pf(I);n=n-(D-r)*n/(2*D)}return 0}static solveToInt(e,t,r){if(t<1e-4||r<1e-4||r>99.9999)return U_(r);e=D_(e);const n=e/180*Math.PI,s=gr(r),o=Le.findResultByJ(n,t,s);if(o!==0)return o;const a=Le.bisectToLimit(s,n);return Pf(a)}static solveToCam(e,t,r){return li.fromInt(Le.solveToInt(e,t,r))}}Le.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];Le.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];Le.Y_FROM_LINRGB=[.2126,.7152,.0722];Le.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];/**
543
568
  * @license
544
569
  * Copyright 2021 Google LLC
545
570
  *
@@ -554,7 +579,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
554
579
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
555
580
  * See the License for the specific language governing permissions and
556
581
  * limitations under the License.
557
- */class xr{static from(e,t,r){return new xr(Ce.solveToInt(e,t,r))}static fromInt(e){return new xr(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=Qt.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=rf(e),this.argb=e}setInternalState(e){const t=Qt.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=rf(e),this.argb=e}inViewingConditions(e){const r=Qt.fromInt(this.toInt()).xyzInViewingConditions(e),n=Qt.fromXyzInViewingConditions(r[0],r[1],r[2],Ri.make());return xr.from(n.hue,n.chroma,ic(r[1]))}}/**
582
+ */class qr{static from(e,t,r){return new qr(Le.solveToInt(e,t,r))}static fromInt(e){return new qr(e)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(Le.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(Le.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(Le.solveToInt(this.internalHue,this.internalChroma,e))}constructor(e){this.argb=e;const t=li.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=Mf(e),this.argb=e}setInternalState(e){const t=li.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=Mf(e),this.argb=e}inViewingConditions(e){const r=li.fromInt(this.toInt()).xyzInViewingConditions(e),n=li.fromXyzInViewingConditions(r[0],r[1],r[2],ji.make());return qr.from(n.hue,n.chroma,$c(r[1]))}}/**
558
583
  * @license
559
584
  * Copyright 2022 Google LLC
560
585
  *
@@ -569,7 +594,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
569
594
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
570
595
  * See the License for the specific language governing permissions and
571
596
  * limitations under the License.
572
- */class mt{static ratioOfTones(e,t){return e=no(0,100,e),t=no(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=ic(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=ic(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}}/**
597
+ */class It{static ratioOfTones(e,t){return e=Po(0,100,e),t=Po(0,100,t),It.ratioOfYs(gr(e),gr(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=gr(e),n=t*(r+5)-5,s=It.ratioOfYs(n,r),o=Math.abs(s-t);if(s<t&&o>.04)return-1;const a=$c(n)+.4;return a<0||a>100?-1:a}static darker(e,t){if(e<0||e>100)return-1;const r=gr(e),n=(r+5)/t-5,s=It.ratioOfYs(r,n),o=Math.abs(s-t);if(s<t&&o>.04)return-1;const a=$c(n)-.4;return a<0||a>100?-1:a}static lighterUnsafe(e,t){const r=It.lighter(e,t);return r<0?100:r}static darkerUnsafe(e,t){const r=It.darker(e,t);return r<0?0:r}}/**
573
598
  * @license
574
599
  * Copyright 2023 Google LLC
575
600
  *
@@ -584,7 +609,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
584
609
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
585
610
  * See the License for the specific language governing permissions and
586
611
  * limitations under the License.
587
- */class Zc{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 Zc.isDisliked(e)?xr.from(e.hue,e.chroma,70):e}}/**
612
+ */class Id{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 Id.isDisliked(e)?qr.from(e.hue,e.chroma,70):e}}/**
588
613
  * @license
589
614
  * Copyright 2022 Google LLC
590
615
  *
@@ -599,7 +624,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
599
624
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
600
625
  * See the License for the specific language governing permissions and
601
626
  * limitations under the License.
602
- */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=no(0,100,v+o*_),(m-v)*_>=o||(v=no(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}}/**
627
+ */class Ie{static fromPalette(e){return new Ie(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,c){if(this.name=e,this.palette=t,this.tone=r,this.isBackground=n,this.background=s,this.secondBackground=o,this.contrastCurve=a,this.toneDeltaPair=c,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,c=r.stayTogether,d=this.background(e).getTone(e),u=a==="nearer"||a==="lighter"&&!e.isDark||a==="darker"&&e.isDark,p=u?n:s,g=u?s:n,v=this.name===p.name,_=e.isDark?1:-1,E=p.contrastCurve.get(e.contrastLevel),x=g.contrastCurve.get(e.contrastLevel),k=p.tone(e);let y=It.ratioOfTones(d,k)>=E?k:Ie.foregroundTone(d,E);const h=g.tone(e);let m=It.ratioOfTones(d,h)>=x?h:Ie.foregroundTone(d,x);return t&&(y=Ie.foregroundTone(d,E),m=Ie.foregroundTone(d,x)),(m-y)*_>=o||(m=Po(0,100,y+o*_),(m-y)*_>=o||(y=Po(0,100,m-o*_))),50<=y&&y<60?_>0?(y=60,m=Math.max(m,y+o*_)):(y=49,m=Math.min(m,y+o*_)):50<=m&&m<60&&(c?_>0?(y=60,m=Math.max(m,y+o*_)):(y=49,m=Math.min(m,y+o*_)):_>0?m=60:m=49),v?y: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(It.ratioOfTones(n,r)>=s||(r=Ie.foregroundTone(n,s)),t&&(r=Ie.foregroundTone(n,s)),this.isBackground&&50<=r&&r<60&&(It.ratioOfTones(49,n)>=s?r=49:r=60),this.secondBackground){const[o,a]=[this.background,this.secondBackground],[c,l]=[o(e).getTone(e),a(e).getTone(e)],[d,u]=[Math.max(c,l),Math.min(c,l)];if(It.ratioOfTones(d,r)>=s&&It.ratioOfTones(u,r)>=s)return r;const p=It.lighter(d,s),g=It.darker(u,s),v=[];return p!==-1&&v.push(p),g!==-1&&v.push(g),Ie.tonePrefersLightForeground(c)||Ie.tonePrefersLightForeground(l)?p<0?100:p:v.length===1?v[0]:g<0?0:g}return r}}static foregroundTone(e,t){const r=It.lighterUnsafe(e,t),n=It.darkerUnsafe(e,t),s=It.ratioOfTones(r,e),o=It.ratioOfTones(n,e);if(Ie.tonePrefersLightForeground(e)){const c=Math.abs(s-o)<.1&&s<t&&o<t;return s>=t||s>=o||c?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 Ie.tonePrefersLightForeground(e)&&!Ie.toneAllowsLightForeground(e)?49:e}}/**
603
628
  * @license
604
629
  * Copyright 2023 Google LLC
605
630
  *
@@ -614,7 +639,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
614
639
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
615
640
  * See the License for the specific language governing permissions and
616
641
  * limitations under the License.
617
- */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?Zn(this.low,this.normal,(e- -1)/1):e<.5?Zn(this.normal,this.medium,(e-0)/.5):e<1?Zn(this.medium,this.high,(e-.5)/.5):this.high}}/**
642
+ */class Fe{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?ks(this.low,this.normal,(e- -1)/1):e<.5?ks(this.normal,this.medium,(e-0)/.5):e<1?ks(this.medium,this.high,(e-.5)/.5):this.high}}/**
618
643
  * @license
619
644
  * Copyright 2023 Google LLC
620
645
  *
@@ -629,7 +654,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
629
654
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
630
655
  * See the License for the specific language governing permissions and
631
656
  * limitations under the License.
632
- */class Jt{constructor(e,t,r,n,s){this.roleA=e,this.roleB=t,this.delta=r,this.polarity=n,this.stayTogether=s}}/**
657
+ */class ai{constructor(e,t,r,n,s){this.roleA=e,this.roleB=t,this.delta=r,this.polarity=n,this.stayTogether=s}}/**
633
658
  * @license
634
659
  * Copyright 2022 Google LLC
635
660
  *
@@ -644,7 +669,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
644
669
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
645
670
  * See the License for the specific language governing permissions and
646
671
  * limitations under the License.
647
- */var us;(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"})(us||(us={}));/**
672
+ */var Ms;(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"})(Ms||(Ms={}));/**
648
673
  * @license
649
674
  * Copyright 2022 Google LLC
650
675
  *
@@ -659,7 +684,7 @@ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList
659
684
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
660
685
  * See the License for the specific language governing permissions and
661
686
  * limitations under the License.
662
- */function fn(i){return i.variant===us.FIDELITY||i.variant===us.CONTENT}function st(i){return i.variant===us.MONOCHROME}function t_(i,e,t,r){let n=t,s=xr.from(i,e,t);if(s.chroma<e){let o=s.chroma;for(;s.chroma<e;){n+=r?-1:1;const a=xr.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)?t_(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 Zc.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 i_=`:host {
687
+ */function Pn(i){return i.variant===Ms.FIDELITY||i.variant===Ms.CONTENT}function ht(i){return i.variant===Ms.MONOCHROME}function H_(i,e,t,r){let n=t,s=qr.from(i,e,t);if(s.chroma<e){let o=s.chroma;for(;s.chroma<e;){n+=r?-1:1;const a=qr.from(i,e,n);if(o>a.chroma||Math.abs(a.chroma-e)<.4)break;const c=Math.abs(a.chroma-e),l=Math.abs(s.chroma-e);c<l&&(s=a),o=Math.max(o,a.chroma)}}return n}class pe{static highestSurface(e){return e.isDark?pe.surfaceBright:pe.surfaceDim}}pe.contentAccentToneDelta=15;pe.primaryPaletteKeyColor=Ie.fromPalette({name:"primary_palette_key_color",palette:i=>i.primaryPalette,tone:i=>i.primaryPalette.keyColor.tone});pe.secondaryPaletteKeyColor=Ie.fromPalette({name:"secondary_palette_key_color",palette:i=>i.secondaryPalette,tone:i=>i.secondaryPalette.keyColor.tone});pe.tertiaryPaletteKeyColor=Ie.fromPalette({name:"tertiary_palette_key_color",palette:i=>i.tertiaryPalette,tone:i=>i.tertiaryPalette.keyColor.tone});pe.neutralPaletteKeyColor=Ie.fromPalette({name:"neutral_palette_key_color",palette:i=>i.neutralPalette,tone:i=>i.neutralPalette.keyColor.tone});pe.neutralVariantPaletteKeyColor=Ie.fromPalette({name:"neutral_variant_palette_key_color",palette:i=>i.neutralVariantPalette,tone:i=>i.neutralVariantPalette.keyColor.tone});pe.background=Ie.fromPalette({name:"background",palette:i=>i.neutralPalette,tone:i=>i.isDark?6:98,isBackground:!0});pe.onBackground=Ie.fromPalette({name:"on_background",palette:i=>i.neutralPalette,tone:i=>i.isDark?90:10,background:i=>pe.background,contrastCurve:new Fe(3,3,4.5,7)});pe.surface=Ie.fromPalette({name:"surface",palette:i=>i.neutralPalette,tone:i=>i.isDark?6:98,isBackground:!0});pe.surfaceDim=Ie.fromPalette({name:"surface_dim",palette:i=>i.neutralPalette,tone:i=>i.isDark?6:new Fe(87,87,80,75).get(i.contrastLevel),isBackground:!0});pe.surfaceBright=Ie.fromPalette({name:"surface_bright",palette:i=>i.neutralPalette,tone:i=>i.isDark?new Fe(24,24,29,34).get(i.contrastLevel):98,isBackground:!0});pe.surfaceContainerLowest=Ie.fromPalette({name:"surface_container_lowest",palette:i=>i.neutralPalette,tone:i=>i.isDark?new Fe(4,4,2,0).get(i.contrastLevel):100,isBackground:!0});pe.surfaceContainerLow=Ie.fromPalette({name:"surface_container_low",palette:i=>i.neutralPalette,tone:i=>i.isDark?new Fe(10,10,11,12).get(i.contrastLevel):new Fe(96,96,96,95).get(i.contrastLevel),isBackground:!0});pe.surfaceContainer=Ie.fromPalette({name:"surface_container",palette:i=>i.neutralPalette,tone:i=>i.isDark?new Fe(12,12,16,20).get(i.contrastLevel):new Fe(94,94,92,90).get(i.contrastLevel),isBackground:!0});pe.surfaceContainerHigh=Ie.fromPalette({name:"surface_container_high",palette:i=>i.neutralPalette,tone:i=>i.isDark?new Fe(17,17,21,25).get(i.contrastLevel):new Fe(92,92,88,85).get(i.contrastLevel),isBackground:!0});pe.surfaceContainerHighest=Ie.fromPalette({name:"surface_container_highest",palette:i=>i.neutralPalette,tone:i=>i.isDark?new Fe(22,22,26,30).get(i.contrastLevel):new Fe(90,90,84,80).get(i.contrastLevel),isBackground:!0});pe.onSurface=Ie.fromPalette({name:"on_surface",palette:i=>i.neutralPalette,tone:i=>i.isDark?90:10,background:i=>pe.highestSurface(i),contrastCurve:new Fe(4.5,7,11,21)});pe.surfaceVariant=Ie.fromPalette({name:"surface_variant",palette:i=>i.neutralVariantPalette,tone:i=>i.isDark?30:90,isBackground:!0});pe.onSurfaceVariant=Ie.fromPalette({name:"on_surface_variant",palette:i=>i.neutralVariantPalette,tone:i=>i.isDark?80:30,background:i=>pe.highestSurface(i),contrastCurve:new Fe(3,4.5,7,11)});pe.inverseSurface=Ie.fromPalette({name:"inverse_surface",palette:i=>i.neutralPalette,tone:i=>i.isDark?90:20});pe.inverseOnSurface=Ie.fromPalette({name:"inverse_on_surface",palette:i=>i.neutralPalette,tone:i=>i.isDark?20:95,background:i=>pe.inverseSurface,contrastCurve:new Fe(4.5,7,11,21)});pe.outline=Ie.fromPalette({name:"outline",palette:i=>i.neutralVariantPalette,tone:i=>i.isDark?60:50,background:i=>pe.highestSurface(i),contrastCurve:new Fe(1.5,3,4.5,7)});pe.outlineVariant=Ie.fromPalette({name:"outline_variant",palette:i=>i.neutralVariantPalette,tone:i=>i.isDark?30:80,background:i=>pe.highestSurface(i),contrastCurve:new Fe(1,1,3,4.5)});pe.shadow=Ie.fromPalette({name:"shadow",palette:i=>i.neutralPalette,tone:i=>0});pe.scrim=Ie.fromPalette({name:"scrim",palette:i=>i.neutralPalette,tone:i=>0});pe.surfaceTint=Ie.fromPalette({name:"surface_tint",palette:i=>i.primaryPalette,tone:i=>i.isDark?80:40,isBackground:!0});pe.primary=Ie.fromPalette({name:"primary",palette:i=>i.primaryPalette,tone:i=>ht(i)?i.isDark?100:0:i.isDark?80:40,isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(3,4.5,7,7),toneDeltaPair:i=>new ai(pe.primaryContainer,pe.primary,10,"nearer",!1)});pe.onPrimary=Ie.fromPalette({name:"on_primary",palette:i=>i.primaryPalette,tone:i=>ht(i)?i.isDark?10:90:i.isDark?20:100,background:i=>pe.primary,contrastCurve:new Fe(4.5,7,11,21)});pe.primaryContainer=Ie.fromPalette({name:"primary_container",palette:i=>i.primaryPalette,tone:i=>Pn(i)?i.sourceColorHct.tone:ht(i)?i.isDark?85:25:i.isDark?30:90,isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(1,1,3,4.5),toneDeltaPair:i=>new ai(pe.primaryContainer,pe.primary,10,"nearer",!1)});pe.onPrimaryContainer=Ie.fromPalette({name:"on_primary_container",palette:i=>i.primaryPalette,tone:i=>Pn(i)?Ie.foregroundTone(pe.primaryContainer.tone(i),4.5):ht(i)?i.isDark?0:100:i.isDark?90:30,background:i=>pe.primaryContainer,contrastCurve:new Fe(3,4.5,7,11)});pe.inversePrimary=Ie.fromPalette({name:"inverse_primary",palette:i=>i.primaryPalette,tone:i=>i.isDark?40:80,background:i=>pe.inverseSurface,contrastCurve:new Fe(3,4.5,7,7)});pe.secondary=Ie.fromPalette({name:"secondary",palette:i=>i.secondaryPalette,tone:i=>i.isDark?80:40,isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(3,4.5,7,7),toneDeltaPair:i=>new ai(pe.secondaryContainer,pe.secondary,10,"nearer",!1)});pe.onSecondary=Ie.fromPalette({name:"on_secondary",palette:i=>i.secondaryPalette,tone:i=>ht(i)?i.isDark?10:100:i.isDark?20:100,background:i=>pe.secondary,contrastCurve:new Fe(4.5,7,11,21)});pe.secondaryContainer=Ie.fromPalette({name:"secondary_container",palette:i=>i.secondaryPalette,tone:i=>{const e=i.isDark?30:90;return ht(i)?i.isDark?30:85:Pn(i)?H_(i.secondaryPalette.hue,i.secondaryPalette.chroma,e,!i.isDark):e},isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(1,1,3,4.5),toneDeltaPair:i=>new ai(pe.secondaryContainer,pe.secondary,10,"nearer",!1)});pe.onSecondaryContainer=Ie.fromPalette({name:"on_secondary_container",palette:i=>i.secondaryPalette,tone:i=>ht(i)?i.isDark?90:10:Pn(i)?Ie.foregroundTone(pe.secondaryContainer.tone(i),4.5):i.isDark?90:30,background:i=>pe.secondaryContainer,contrastCurve:new Fe(3,4.5,7,11)});pe.tertiary=Ie.fromPalette({name:"tertiary",palette:i=>i.tertiaryPalette,tone:i=>ht(i)?i.isDark?90:25:i.isDark?80:40,isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(3,4.5,7,7),toneDeltaPair:i=>new ai(pe.tertiaryContainer,pe.tertiary,10,"nearer",!1)});pe.onTertiary=Ie.fromPalette({name:"on_tertiary",palette:i=>i.tertiaryPalette,tone:i=>ht(i)?i.isDark?10:90:i.isDark?20:100,background:i=>pe.tertiary,contrastCurve:new Fe(4.5,7,11,21)});pe.tertiaryContainer=Ie.fromPalette({name:"tertiary_container",palette:i=>i.tertiaryPalette,tone:i=>{if(ht(i))return i.isDark?60:49;if(!Pn(i))return i.isDark?30:90;const e=i.tertiaryPalette.getHct(i.sourceColorHct.tone);return Id.fixIfDisliked(e).tone},isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(1,1,3,4.5),toneDeltaPair:i=>new ai(pe.tertiaryContainer,pe.tertiary,10,"nearer",!1)});pe.onTertiaryContainer=Ie.fromPalette({name:"on_tertiary_container",palette:i=>i.tertiaryPalette,tone:i=>ht(i)?i.isDark?0:100:Pn(i)?Ie.foregroundTone(pe.tertiaryContainer.tone(i),4.5):i.isDark?90:30,background:i=>pe.tertiaryContainer,contrastCurve:new Fe(3,4.5,7,11)});pe.error=Ie.fromPalette({name:"error",palette:i=>i.errorPalette,tone:i=>i.isDark?80:40,isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(3,4.5,7,7),toneDeltaPair:i=>new ai(pe.errorContainer,pe.error,10,"nearer",!1)});pe.onError=Ie.fromPalette({name:"on_error",palette:i=>i.errorPalette,tone:i=>i.isDark?20:100,background:i=>pe.error,contrastCurve:new Fe(4.5,7,11,21)});pe.errorContainer=Ie.fromPalette({name:"error_container",palette:i=>i.errorPalette,tone:i=>i.isDark?30:90,isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(1,1,3,4.5),toneDeltaPair:i=>new ai(pe.errorContainer,pe.error,10,"nearer",!1)});pe.onErrorContainer=Ie.fromPalette({name:"on_error_container",palette:i=>i.errorPalette,tone:i=>ht(i)?i.isDark?90:10:i.isDark?90:30,background:i=>pe.errorContainer,contrastCurve:new Fe(3,4.5,7,11)});pe.primaryFixed=Ie.fromPalette({name:"primary_fixed",palette:i=>i.primaryPalette,tone:i=>ht(i)?40:90,isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(1,1,3,4.5),toneDeltaPair:i=>new ai(pe.primaryFixed,pe.primaryFixedDim,10,"lighter",!0)});pe.primaryFixedDim=Ie.fromPalette({name:"primary_fixed_dim",palette:i=>i.primaryPalette,tone:i=>ht(i)?30:80,isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(1,1,3,4.5),toneDeltaPair:i=>new ai(pe.primaryFixed,pe.primaryFixedDim,10,"lighter",!0)});pe.onPrimaryFixed=Ie.fromPalette({name:"on_primary_fixed",palette:i=>i.primaryPalette,tone:i=>ht(i)?100:10,background:i=>pe.primaryFixedDim,secondBackground:i=>pe.primaryFixed,contrastCurve:new Fe(4.5,7,11,21)});pe.onPrimaryFixedVariant=Ie.fromPalette({name:"on_primary_fixed_variant",palette:i=>i.primaryPalette,tone:i=>ht(i)?90:30,background:i=>pe.primaryFixedDim,secondBackground:i=>pe.primaryFixed,contrastCurve:new Fe(3,4.5,7,11)});pe.secondaryFixed=Ie.fromPalette({name:"secondary_fixed",palette:i=>i.secondaryPalette,tone:i=>ht(i)?80:90,isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(1,1,3,4.5),toneDeltaPair:i=>new ai(pe.secondaryFixed,pe.secondaryFixedDim,10,"lighter",!0)});pe.secondaryFixedDim=Ie.fromPalette({name:"secondary_fixed_dim",palette:i=>i.secondaryPalette,tone:i=>ht(i)?70:80,isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(1,1,3,4.5),toneDeltaPair:i=>new ai(pe.secondaryFixed,pe.secondaryFixedDim,10,"lighter",!0)});pe.onSecondaryFixed=Ie.fromPalette({name:"on_secondary_fixed",palette:i=>i.secondaryPalette,tone:i=>10,background:i=>pe.secondaryFixedDim,secondBackground:i=>pe.secondaryFixed,contrastCurve:new Fe(4.5,7,11,21)});pe.onSecondaryFixedVariant=Ie.fromPalette({name:"on_secondary_fixed_variant",palette:i=>i.secondaryPalette,tone:i=>ht(i)?25:30,background:i=>pe.secondaryFixedDim,secondBackground:i=>pe.secondaryFixed,contrastCurve:new Fe(3,4.5,7,11)});pe.tertiaryFixed=Ie.fromPalette({name:"tertiary_fixed",palette:i=>i.tertiaryPalette,tone:i=>ht(i)?40:90,isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(1,1,3,4.5),toneDeltaPair:i=>new ai(pe.tertiaryFixed,pe.tertiaryFixedDim,10,"lighter",!0)});pe.tertiaryFixedDim=Ie.fromPalette({name:"tertiary_fixed_dim",palette:i=>i.tertiaryPalette,tone:i=>ht(i)?30:80,isBackground:!0,background:i=>pe.highestSurface(i),contrastCurve:new Fe(1,1,3,4.5),toneDeltaPair:i=>new ai(pe.tertiaryFixed,pe.tertiaryFixedDim,10,"lighter",!0)});pe.onTertiaryFixed=Ie.fromPalette({name:"on_tertiary_fixed",palette:i=>i.tertiaryPalette,tone:i=>ht(i)?100:10,background:i=>pe.tertiaryFixedDim,secondBackground:i=>pe.tertiaryFixed,contrastCurve:new Fe(4.5,7,11,21)});pe.onTertiaryFixedVariant=Ie.fromPalette({name:"on_tertiary_fixed_variant",palette:i=>i.tertiaryPalette,tone:i=>ht(i)?90:30,background:i=>pe.tertiaryFixedDim,secondBackground:i=>pe.tertiaryFixed,contrastCurve:new Fe(3,4.5,7,11)});const W_=`:host {
663
688
  --mdui-color-primary-light: var(--mdui-color-primary-light);
664
689
  --mdui-color-primary-dark: var(--mdui-color-primary-dark);
665
690
  --mdui-color-background-light: var(--mdui-color-background-light);
@@ -672,4 +697,4 @@ mdui-text-field::part(input) {
672
697
  form.mode-edit { --label-width: 0em; }
673
698
  .property-instance { margin-bottom:14px; }
674
699
  .mode-edit .property-instance *[required]::part(icon) { align-self: flex-start; padding-top: 0.7em; }
675
- .mode-edit .property-instance *[required]::part(icon)::before { color: red; content: '\\2736'; font-size: 0.6em; }`;class r_ extends Bm{constructor(){super(i_)}createDefaultTemplate(e,t,r,n,s){n.classList.add("editor"),s?.datatype?n.shaclDatatype=s.datatype:t instanceof ai&&(n.shaclDatatype=t.datatype),s?.minCount!==void 0&&(n.dataset.minCount=String(s.minCount)),s?.class&&(n.dataset.class=s.class.value),s?.nodeKind?n.dataset.nodeKind=s.nodeKind.value:t instanceof so&&(n.dataset.nodeKind=Ae+"IRI"),(s?.hasValue||s?.readonly)&&(n.disabled=!0),n.value=t?.value||s?.defaultValue?.value||"";const o=s?.description?s.description.value:s?.pattern?s.pattern:null;o&&n.setAttribute("placeholder",o),r&&n.setAttribute("required","true");const a=document.createElement("div");if(e){const l=document.createElement("label");l.htmlFor=n.id,l.innerText=e,a.appendChild(l)}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){const s=new Te;s.variant="outlined",s.type="number",s.label=e,s.helper=n.description?.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)),n.datatype?.value!==tr+"integer"&&s.setAttribute("step","0.1"),this.createDefaultTemplate("",t,r,s,n)}createListEditor(e,t,r,n,s){const o=new pt;o.clearable=!0;const a=this.createDefaultTemplate(e,null,r,o,s),l=document.createElement("ul");let c=!0;const d=(f,g)=>{const y=document.createElement("li");if(typeof f.value=="string"?(y.dataset.value=f.value,y.innerText=f.label?f.label:f.value):(f.value instanceof ai&&f.value.datatype.equals(Am)?y.dataset.value=f.value.value:y.dataset.value=f.value.id,y.innerText=f.label?f.label:f.value.value),g.appendChild(y),f.children?.length){c=!1;const b=document.createElement("ul");y.appendChild(b);for(const _ of f.children)d(_,b)}};for(const f of n)d(f,l);return c||(o.collapse=!0),o.appendChild(l),t&&(o.value=t.value),a}createBooleanEditor(e,t,r,n){const s=new gt,o=this.createDefaultTemplate("",t,r,s,n);return s.removeAttribute("required"),t instanceof ai&&(s.checked=t.value==="true"),s.innerText=e,o}createDateEditor(e,t,r,n){const s=new Te;s.variant="outlined",s.helper=n?.description?.value||n?.label||"",n.datatype?.value===tr+"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 a=new Date(t.value).toISOString();n.datatype?.value===tr+"dateTime"?a=a.slice(0,19):a=a.slice(0,10),s.value=a}catch(a){console.error(a,t)}return o}createLangStringEditor(e,t,r,n){const s=this.createTextEditor(e,t,r,n),o=s.querySelector(":scope .editor");let a;if(n.languageIn?.length){a=document.createElement("select");for(const l of n.languageIn){const c=document.createElement("option");c.innerText=l.value,a.appendChild(c)}}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",l=>{l.stopPropagation(),o&&(o.dataset.lang=a.value,o.dispatchEvent(new Event("change",{bubbles:!0})))}),t instanceof ai&&(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=>{if(s.files?.length){o.stopPropagation();const a=new FileReader;a.readAsDataURL(s.files[0]),a.onload=()=>{s.binaryData=btoa(a.result),s.parentElement?.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 n_ extends M0{constructor(){super(new r_)}}window.customElements.define("shacl-form",n_);export{Zu as Config,_y as Loader,h_ as Plugin,n_ as ShaclForm,Pm as ShaclPropertyTemplate,Bm as Theme,Er as findLabel,zm as registerPlugin,xy as setSharedShapesGraph};
700
+ .mode-edit .property-instance *[required]::part(icon)::before { color: red; content: '\\2736'; font-size: 0.6em; }`;class G_ extends bg{constructor(){super(W_)}createDefaultTemplate(e,t,r,n,s){n.classList.add("editor"),s?.datatype?n.shaclDatatype=s.datatype:t instanceof yi&&(n.shaclDatatype=t.datatype),s?.minCount!==void 0&&(n.dataset.minCount=String(s.minCount)),s?.class&&(n.dataset.class=s.class.value),s?.nodeKind?n.dataset.nodeKind=s.nodeKind.value:t instanceof Mo&&(n.dataset.nodeKind=Oe+"IRI"),(s?.hasValue||s?.readonly)&&(n.disabled=!0),n.value=t?.value||s?.defaultValue?.value||"";const o=s?.description?s.description.value: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 Ne;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){const s=new Ne;s.variant="outlined",s.type="number",s.label=e,s.helper=n.description?.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)),n.datatype?.value!==br+"integer"&&s.setAttribute("step","0.1"),this.createDefaultTemplate("",t,r,s,n)}createListEditor(e,t,r,n,s){const o=new St;o.clearable=!0;const a=this.createDefaultTemplate(e,null,r,o,s),c=document.createElement("ul");let l=!0;const d=(u,p)=>{const g=document.createElement("li");if(typeof u.value=="string"?(g.dataset.value=u.value,g.innerText=u.label?u.label:u.value):(u.value instanceof yi&&u.value.datatype.equals(cg)?g.dataset.value=u.value.value:g.dataset.value=u.value.id,g.innerText=u.label?u.label:u.value.value),p.appendChild(g),u.children?.length){l=!1;const v=document.createElement("ul");g.appendChild(v);for(const _ of u.children)d(_,v)}};for(const u of n)d(u,c);return l||(o.collapse=!0),o.appendChild(c),t&&(o.value=t.value),a}createBooleanEditor(e,t,r,n){const s=new Tt,o=this.createDefaultTemplate("",t,r,s,n);return s.removeAttribute("required"),t instanceof yi&&(s.checked=t.value==="true"),s.innerText=e,o}createDateEditor(e,t,r,n){const s=new Ne;s.variant="outlined",s.helper=n?.description?.value||n?.label||"",n.datatype?.value===br+"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 a=new Date(t.value).toISOString();n.datatype?.value===br+"dateTime"?a=a.slice(0,19):a=a.slice(0,10),s.value=a}catch(a){console.error(a,t)}return o}createLangStringEditor(e,t,r,n){const s=this.createTextEditor(e,t,r,n),o=s.querySelector(":scope .editor");let a;if(n.languageIn?.length){a=document.createElement("select");for(const c of n.languageIn){const l=document.createElement("option");l.innerText=c.value,a.appendChild(l)}}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 yi&&(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=>{if(s.files?.length){o.stopPropagation();const a=new FileReader;a.readAsDataURL(s.files[0]),a.onload=()=>{s.binaryData=btoa(a.result),s.parentElement?.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 ir,r.classList.add("primary")):(r=new ir,r.classList.add("secondary")),r.innerHTML=e,r}}class K_ extends Rw{constructor(){super(new G_)}}window.customElements.define("shacl-form",K_);export{qh as Config,fy as Loader,ix as Plugin,K_ as ShaclForm,mg as ShaclPropertyTemplate,bg as Theme,js as findLabel,xg as registerPlugin,py as setSharedShapesGraph};